mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Small fixes
This commit is contained in:
parent
86295f6e5b
commit
2ac2168477
33 changed files with 51 additions and 35 deletions
|
|
@ -12,6 +12,7 @@
|
|||
Enums = require('Common/Enums'),
|
||||
Utils = require('Common/Utils'),
|
||||
Links = require('Common/Links'),
|
||||
Plugins = require('Common/Plugins'),
|
||||
|
||||
Settings = require('Storage/Settings'),
|
||||
|
||||
|
|
@ -71,6 +72,8 @@
|
|||
oParameters['XToken'] = Settings.settingsGet('Token');
|
||||
}
|
||||
|
||||
Plugins.runHook('ajax-default-request', [sAction, oParameters, sAdditionalGetString]);
|
||||
|
||||
this.setTrigger(fTrigger, true);
|
||||
|
||||
oH = $.ajax({
|
||||
|
|
@ -83,12 +86,26 @@
|
|||
'global': true
|
||||
}).always(function (oData, sTextStatus) {
|
||||
|
||||
var bCached = false;
|
||||
var bCached = false, sType = Enums.StorageResultType.Error;
|
||||
if (oData && oData['Time'])
|
||||
{
|
||||
bCached = Utils.pInt(oData['Time']) > Utils.microtime() - iStart;
|
||||
}
|
||||
|
||||
// backward capability
|
||||
switch (true)
|
||||
{
|
||||
case 'success' === sTextStatus && oData && oData.Result && sAction === oData.Action:
|
||||
sType = Enums.StorageResultType.Success;
|
||||
break;
|
||||
case 'abort' === sTextStatus && (!oData || !oData.__aborted__):
|
||||
sType = Enums.StorageResultType.Abort;
|
||||
break;
|
||||
}
|
||||
|
||||
Plugins.runHook('ajax-default-response', [sAction,
|
||||
Enums.StorageResultType.Success === sType ? oData : null, sType, bCached, oParameters]);
|
||||
|
||||
if ('success' === sTextStatus)
|
||||
{
|
||||
if (oData && oData.Result && sAction === oData.Action)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue