From 9f333dcf0dff5d6ab1451339e46806114459caae Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 3 Aug 2012 16:40:23 +0300 Subject: [PATCH] from now in anyload elements could be not appended --- client.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/client.js b/client.js index f70ed9ed..3a9e0de1 100644 --- a/client.js +++ b/client.js @@ -9,7 +9,7 @@ var CloudCommander=(function(){ "use strict"; /* Клиентский обьект, содержащий функциональную часть*/ -var CloudClient={ +var CloudClient = { /* Конструктор CloudClient, который * выполняет весь функционал по * инициализации @@ -89,9 +89,10 @@ CloudClient._images={ var lE = Util.getById('loading-image'); if (!lE) lE = Util.anyload({ - name : 'span', - class : 'icon loading', - id : 'loading-image' + name : 'span', + class : 'icon loading', + id : 'loading-image' + not_append : true, }); return lE; @@ -102,9 +103,10 @@ CloudClient._images={ var lE = Util.getById('error-image'); if (!lE) lE = Util.anyload({ - name : 'span', - class : 'icon error', - id : 'error-image' + name : 'span', + class : 'icon error', + id : 'error-image', + not_append : true, }); return lE; @@ -181,7 +183,7 @@ CloudClient.Util = (function(){ * @pId - id * @pElement - элемент, дочерним которо будет этот * @pParams_o = {name: '', src: ' ',func: '', style: '', id: '', parent: '', - async: false, inner: 'id{color:red, class:''}'} + async: false, inner: 'id{color:red, }, class:'', not_append: false} */ this.anyload = function(pParams_o){ /* убираем путь к файлу, оставляя только название файла */ @@ -240,7 +242,8 @@ CloudClient.Util = (function(){ if(lAsync || lAsync === undefined) element.async = true; - (pParams_o.parent || document.body).appendChild(element); + if(!pParams_o.not_append) + (pParams_o.parent || document.body).appendChild(element); if(pParams_o.inner){ element.innerHTML = pParams_o.inner;