mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-15 20:24:51 +08:00
37 lines
688 B
JavaScript
37 lines
688 B
JavaScript
|
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
|
||
|
|
||
|
/**
|
||
|
* @constructor
|
||
|
*/
|
||
|
function FilterModel()
|
||
|
{
|
||
|
this.enabled = ko.observable(true);
|
||
|
|
||
|
this.conditions = ko.observableArray([]);
|
||
|
|
||
|
this.action = ko.observable(Enums.FiltersAction.None);
|
||
|
}
|
||
|
|
||
|
FilterModel.prototype.deleteCondition = function (oCondition)
|
||
|
{
|
||
|
this.conditions.remove(oCondition);
|
||
|
};
|
||
|
|
||
|
FilterModel.prototype.addCondition = function ()
|
||
|
{
|
||
|
this.conditions.push(new FilterConditionModel());
|
||
|
};
|
||
|
|
||
|
FilterModel.prototype.parse = function (oItem)
|
||
|
{
|
||
|
var bResult = false;
|
||
|
if (oItem && 'Object/Filter' === oItem['@Object'])
|
||
|
{
|
||
|
this.name(Utils.pString(oItem['Name']));
|
||
|
|
||
|
bResult = true;
|
||
|
}
|
||
|
|
||
|
return bResult;
|
||
|
};
|