aboutsummaryrefslogtreecommitdiff
path: root/web/app/ErrorManager.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-04 18:23:32 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-04 18:23:32 +1300
commit99d132dc78b42b6cc5833b3a7faf30d2fe56186f (patch)
tree045052b15478c32c44f36a07c70885a756ea19b3 /web/app/ErrorManager.js
parentdcfe1d48998c3fb3baa704fafed43d996f329a07 (diff)
downloadtrackermap-server-99d132dc78b42b6cc5833b3a7faf30d2fe56186f.tar.gz
trackermap-server-99d132dc78b42b6cc5833b3a7faf30d2fe56186f.tar.bz2
trackermap-server-99d132dc78b42b6cc5833b3a7faf30d2fe56186f.zip
Disable JavaScript strict mode
Diffstat (limited to 'web/app/ErrorManager.js')
-rw-r--r--web/app/ErrorManager.js46
1 files changed, 21 insertions, 25 deletions
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);
+ }
-})();
+});