diff --git a/lib/client/dom.js b/lib/client/dom.js index 4fa1d614..de5113a2 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -109,34 +109,13 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; return image; } - function error(jqXHR, isQuiet) { - var isStr = Util.type.string(jqXHR), - image = Images.error(), - response = '', - statusText = '', - status = 0, - text = ''; - - if (jqXHR) - if (isStr) { - text = jqXHR; - } else { - response = jqXHR.responseText; - statusText = jqXHR.statusText; - status = jqXHR.status; - text = status === 404 ? response : statusText; - } + function error(text) { + var image = Images.error(); DOM.show(image); image.title = text; - if (text) - setTimeout(function() { - if (!isQuiet) - Dialog.alert(text); - - CloudCmd.log(text); - }, 100); + CloudCmd.log(text); return image; } diff --git a/lib/client/load.js b/lib/client/load.js index 3a56a737..8e0ebb29 100644 --- a/lib/client/load.js +++ b/lib/client/load.js @@ -52,7 +52,6 @@ var Util, DOM; funcError = function() { var callback, template = 'file {{ src }} could not be loaded', - isQuit = true, msg = rendy(template, { src: p.src }), @@ -64,7 +63,7 @@ var Util, DOM; parent.removeChild(element); - Images.show.error(msg, isQuit); + Images.show.error(msg); Util.exec(callback, error); }; diff --git a/lib/client/rest.js b/lib/client/rest.js index dd2cc795..7a54b615 100644 --- a/lib/client/rest.js +++ b/lib/client/rest.js @@ -187,7 +187,17 @@ var Util, DOM, CloudFunc, CloudCmd; url : p.url, data : p.data, dataType : p.dataType, - error : Images.show.error, + error : function(jqXHR) { + var response = jqXHR.responseText, + statusText = jqXHR.statusText, + status = jqXHR.status, + text = status === 404 ? response : statusText; + + Images.show.error(text); + setTimeout(function() { + DOM.Dialog.alert(text); + }, 100); + }, success : function(data) { Images.hide();