snappymail/dev/Settings/SettingsFilters.js

39 lines
814 B
JavaScript
Raw Normal View History

2014-08-21 23:08:34 +08:00
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (module) {
'use strict';
var
ko = require('../External/ko.js'),
Utils = require('../Common/Utils.js'),
2014-08-22 23:08:56 +08:00
kn = require('../Knoin/Knoin.js'),
2014-08-21 23:08:34 +08:00
PopupsFilterViewModel = require('../ViewModels/Popups/PopupsFilterViewModel.js')
;
/**
* @constructor
*/
function SettingsFilters()
{
this.filters = ko.observableArray([]);
this.filters.loading = ko.observable(false);
this.filters.subscribe(function () {
Utils.windowResize();
});
}
SettingsFilters.prototype.deleteFilter = function (oFilter)
{
this.filters.remove(oFilter);
};
SettingsFilters.prototype.addFilter = function ()
{
kn.showScreenPopup(PopupsFilterViewModel, [new FilterModel()]);
};
module.exports = SettingsFilters;
}(module));