mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
Fixed Opening an email with specific content „hangs” RainLoop in the browser (Closes #308)
Code refactoring
This commit is contained in:
parent
af43329902
commit
7a374ebe03
40 changed files with 1100 additions and 181 deletions
62
dev/Model/FilterCondition.js
Normal file
62
dev/Model/FilterCondition.js
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
|
||||
(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
var
|
||||
ko = require('ko'),
|
||||
|
||||
Enums = require('Common/Enums')
|
||||
;
|
||||
|
||||
/**
|
||||
* @param {*} oKoList
|
||||
* @constructor
|
||||
*/
|
||||
function FilterConditionModel(oKoList)
|
||||
{
|
||||
this.parentList = oKoList;
|
||||
|
||||
this.field = ko.observable(Enums.FilterConditionField.From);
|
||||
|
||||
this.fieldOptions = [ // TODO i18n
|
||||
{'id': Enums.FilterConditionField.From, 'name': 'From'},
|
||||
{'id': Enums.FilterConditionField.Recipient, 'name': 'Recipient (To or CC)'},
|
||||
{'id': Enums.FilterConditionField.To, 'name': 'To'},
|
||||
{'id': Enums.FilterConditionField.Subject, 'name': 'Subject'}
|
||||
];
|
||||
|
||||
this.type = ko.observable(Enums.FilterConditionType.EqualTo);
|
||||
|
||||
this.typeOptions = [ // TODO i18n
|
||||
{'id': Enums.FilterConditionType.EqualTo, 'name': 'Equal To'},
|
||||
{'id': Enums.FilterConditionType.NotEqualTo, 'name': 'Not Equal To'},
|
||||
{'id': Enums.FilterConditionType.Contains, 'name': 'Contains'},
|
||||
{'id': Enums.FilterConditionType.NotContains, 'name': 'Not Contains'}
|
||||
];
|
||||
|
||||
this.value = ko.observable('');
|
||||
|
||||
this.template = ko.computed(function () {
|
||||
|
||||
var sTemplate = '';
|
||||
switch (this.type())
|
||||
{
|
||||
default:
|
||||
sTemplate = 'SettingsFiltersConditionDefault';
|
||||
break;
|
||||
}
|
||||
|
||||
return sTemplate;
|
||||
|
||||
}, this);
|
||||
}
|
||||
|
||||
FilterConditionModel.prototype.removeSelf = function ()
|
||||
{
|
||||
this.parentList.remove(this);
|
||||
};
|
||||
|
||||
module.exports = FilterConditionModel;
|
||||
|
||||
}());
|
||||
Loading…
Add table
Add a link
Reference in a new issue