Fixed Opening an email with specific content „hangs” RainLoop in the browser (Closes #308)

Code refactoring
This commit is contained in:
RainLoop Team 2014-09-05 19:53:44 +04:00
parent af43329902
commit 7a374ebe03
40 changed files with 1100 additions and 181 deletions

View file

@ -47,7 +47,7 @@
SettingsContacts.prototype.onBuild = function ()
{
Data.contactsAutosave.subscribe(function (bValue) {
Remote.saveSettings(Utils.emptyFunction, {
Remote.saveSettings(null, {
'ContactsAutosave': bValue ? '1' : '0'
});
});

View file

@ -30,7 +30,7 @@
SettingsFilters.prototype.addFilter = function ()
{
var
FilterModel = require('Model:Filter')
FilterModel = require('Model/Filter')
;
require('App:Knoin').showScreenPopup(

View file

@ -76,28 +76,23 @@
self.languageTrigger(Enums.SaveSettingsStep.Animate);
$.ajax({
'url': LinkBuilder.langLink(sValue),
'dataType': 'script',
'cache': true
}).done(function() {
Utils.i18nReload();
Utils.reloadLanguage(sValue, function() {
self.languageTrigger(Enums.SaveSettingsStep.TrueResult);
}).fail(function() {
}, function() {
self.languageTrigger(Enums.SaveSettingsStep.FalseResult);
}).always(function() {
}, function() {
_.delay(function () {
self.languageTrigger(Enums.SaveSettingsStep.Idle);
}, 1000);
});
Remote.saveSettings(Utils.emptyFunction, {
Remote.saveSettings(null, {
'Language': sValue
});
});
Data.editorDefaultType.subscribe(function (sValue) {
Remote.saveSettings(Utils.emptyFunction, {
Remote.saveSettings(null, {
'EditorDefaultType': sValue
});
});
@ -109,20 +104,20 @@
});
Data.showImages.subscribe(function (bValue) {
Remote.saveSettings(Utils.emptyFunction, {
Remote.saveSettings(null, {
'ShowImages': bValue ? '1' : '0'
});
});
Data.interfaceAnimation.subscribe(function (sValue) {
Remote.saveSettings(Utils.emptyFunction, {
Remote.saveSettings(null, {
'InterfaceAnimation': sValue
});
});
Data.useDesktopNotifications.subscribe(function (bValue) {
Utils.timeOutAction('SaveDesktopNotifications', function () {
Remote.saveSettings(Utils.emptyFunction, {
Remote.saveSettings(null, {
'DesktopNotifications': bValue ? '1' : '0'
});
}, 3000);
@ -130,7 +125,7 @@
Data.replySameFolder.subscribe(function (bValue) {
Utils.timeOutAction('SaveReplySameFolder', function () {
Remote.saveSettings(Utils.emptyFunction, {
Remote.saveSettings(null, {
'ReplySameFolder': bValue ? '1' : '0'
});
}, 3000);
@ -140,7 +135,7 @@
Data.messageList([]);
Remote.saveSettings(Utils.emptyFunction, {
Remote.saveSettings(null, {
'UseThreads': bValue ? '1' : '0'
});
});
@ -149,13 +144,13 @@
Data.messageList([]);
Remote.saveSettings(Utils.emptyFunction, {
Remote.saveSettings(null, {
'Layout': nValue
});
});
Data.useCheckboxesInList.subscribe(function (bValue) {
Remote.saveSettings(Utils.emptyFunction, {
Remote.saveSettings(null, {
'UseCheckboxesInList': bValue ? '1' : '0'
});
});

View file

@ -29,8 +29,8 @@
this.themeTrigger = ko.observable(Enums.SaveSettingsStep.Idle).extend({'throttle': 100});
this.oLastAjax = null;
this.iTimer = 0;
this.oThemeAjaxRequest = null;
Data.theme.subscribe(function (sValue) {
@ -62,12 +62,12 @@
window.clearTimeout(self.iTimer);
self.themeTrigger(Enums.SaveSettingsStep.Animate);
if (this.oLastAjax && this.oLastAjax.abort)
if (this.oThemeAjaxRequest && this.oThemeAjaxRequest.abort)
{
this.oLastAjax.abort();
this.oThemeAjaxRequest.abort();
}
this.oLastAjax = $.ajax({
this.oThemeAjaxRequest = $.ajax({
'url': sUrl,
'dataType': 'json'
}).done(function(aData) {
@ -103,7 +103,7 @@
self.themeTrigger(Enums.SaveSettingsStep.Idle);
}, 1000);
self.oLastAjax = null;
self.oThemeAjaxRequest = null;
});
}