From 99d132dc78b42b6cc5833b3a7faf30d2fe56186f Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 4 Oct 2015 18:23:32 +1300 Subject: Disable JavaScript strict mode --- web/app/ErrorManager.js | 46 +++++++++++++++++++++------------------------- 1 file changed, 21 insertions(+), 25 deletions(-) (limited to 'web/app/ErrorManager.js') diff --git a/web/app/ErrorManager.js b/web/app/ErrorManager.js index e98b29d0f..50fa347c2 100644 --- a/web/app/ErrorManager.js +++ b/web/app/ErrorManager.js @@ -13,36 +13,32 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -(function () { - 'use strict'; - Ext.define('Traccar.ErrorManager', { - singleton: true, +Ext.define('Traccar.ErrorManager', { + singleton: true, - check: function (success, response) { - var result; - if (success) { - result = Ext.decode(response.responseText); - if (result.success || result.error === undefined) { - return true; - } else { - Ext.Msg.alert(Strings.errorTitle, result.error); - return false; - } + check: function (success, response) { + var result; + if (success) { + result = Ext.decode(response.responseText); + if (result.success || result.error === undefined) { + return true; } else { - if (response.statusText) { - Ext.Msg.alert(Strings.errorTitle, response.statusText); - } else { - Ext.Msg.alert(Strings.errorTitle, response.status.toString()); // TODO: text message - } + Ext.Msg.alert(Strings.errorTitle, result.error); return false; } - }, - - error: function (message) { - Ext.Msg.alert(Strings.errorTitle, message); + } else { + if (response.statusText) { + Ext.Msg.alert(Strings.errorTitle, response.statusText); + } else { + Ext.Msg.alert(Strings.errorTitle, response.status.toString()); // TODO: text message + } + return false; } + }, - }); + error: function (message) { + Ext.Msg.alert(Strings.errorTitle, message); + } -})(); +}); -- cgit v1.2.3