snappymail/dev/Stores/User/App.js
RainLoop Team aa84077ac4 Sound notification
Additional code refactoring
2015-01-27 01:06:00 +04:00

58 lines
1.3 KiB
JavaScript

(function () {
'use strict';
var
ko = require('ko'),
Globals = require('Common/Globals'),
Settings = require('Storage/Settings')
;
/**
* @constructor
*/
function AppUserStore()
{
// same
this.allowLanguagesOnSettings = ko.observable(true);
this.allowLanguagesOnLogin = ko.observable(true);
// ----
this.contactsAutosave = ko.observable(false);
this.useLocalProxyForExternalImages = ko.observable(false);
this.contactsIsAllowed = ko.observable(false);
this.interfaceAnimation = ko.observable(true);
this.interfaceAnimation.subscribe(function (bValue) {
if (Globals.bMobileDevice || !bValue)
{
Globals.$html.removeClass('rl-anim').addClass('no-rl-anim');
}
else
{
Globals.$html.removeClass('no-rl-anim').addClass('rl-anim');
}
});
this.interfaceAnimation.valueHasMutated();
}
AppUserStore.prototype.populate = function()
{
this.allowLanguagesOnLogin(!!Settings.settingsGet('AllowLanguagesOnLogin'));
this.allowLanguagesOnSettings(!!Settings.settingsGet('AllowLanguagesOnSettings'));
this.useLocalProxyForExternalImages(!!Settings.settingsGet('UseLocalProxyForExternalImages'));
this.contactsIsAllowed(!!Settings.settingsGet('ContactsIsAllowed'));
this.interfaceAnimation(!!Settings.settingsGet('InterfaceAnimation'));
};
module.exports = new AppUserStore();
}());