From d243caa095ece5c130250d02e4f3ae7632a9db36 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Tue, 23 May 2017 14:45:18 +0500 Subject: Implement testing computedAttribute --- web/app/Application.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'web/app/Application.js') diff --git a/web/app/Application.js b/web/app/Application.js index d73378c5..0125cd0f 100644 --- a/web/app/Application.js +++ b/web/app/Application.js @@ -164,15 +164,24 @@ Ext.define('Traccar.Application', { } }, - showError: function (error) { + showError: function (error, success) { + var title, general; + if (success) { + title = Strings.infoTitle; + general = Strings.infoGeneral; + } else { + title = Strings.errorTitle; + general = Strings.errorGeneral; + } + if (Ext.isString(error)) { - Ext.Msg.alert(Strings.errorTitle, error); + Ext.Msg.alert(title, error); } else if (error.responseText) { - Ext.Msg.alert(Strings.errorTitle, Strings.errorGeneral + + Ext.Msg.alert(title, general + '

'); } else if (error.statusText) { - Ext.Msg.alert(Strings.errorTitle, error.statusText); + Ext.Msg.alert(title, error.statusText); } else { Ext.Msg.alert(Strings.errorTitle, Strings.errorConnection); } -- cgit v1.2.3