snappymail/dev/Settings/SettingsFilters.js
2014-08-21 19:08:34 +04:00

40 lines
No EOL
889 B
JavaScript

/* 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'),
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();
});
}
kn.addSettingsViewModel(SettingsFilters, 'SettingsFilters', 'SETTINGS_LABELS/LABEL_FILTERS_NAME', 'filters');
SettingsFilters.prototype.deleteFilter = function (oFilter)
{
this.filters.remove(oFilter);
};
SettingsFilters.prototype.addFilter = function ()
{
kn.showScreenPopup(PopupsFilterViewModel, [new FilterModel()]);
};
module.exports = SettingsFilters;
}(module));