From 749838e4793de672bca647d083664027b0b1abd0 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 30 May 2014 11:05:52 -0400 Subject: [PATCH] feature(dom) showError: isQuiet --- lib/client/dom.js | 6 ++++-- lib/client/load.js | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/client/dom.js b/lib/client/dom.js index 7b00e786..34725505 100644 --- a/lib/client/dom.js +++ b/lib/client/dom.js @@ -114,7 +114,7 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; /** * show error image (usualy after error on ajax request) */ - this.showError = function(jqXHR) { + this.showError = function(jqXHR, isQuiet) { var isStr = Util.isString(jqXHR), image = Images.error(), response = '', @@ -137,7 +137,9 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog; if (text) setTimeout(function() { - Dialog.alert(text); + if (!isQuiet) + Dialog.alert(text); + Util.log(text); }, 100); diff --git a/lib/client/load.js b/lib/client/load.js index e06cbbe6..18ba2606 100644 --- a/lib/client/load.js +++ b/lib/client/load.js @@ -51,13 +51,14 @@ var Util, DOM; funcError = function() { var template = 'file {{ src }} could not be loaded', + isQuit = !!onError, msg = Util.render(template, { src: p.src }); parent.removeChild(element); - Images.showError(msg); + Images.showError(msg, isQuit); Util.exec(onError); };