From 335ba41f1d0284dc1921b0beeada69fee57192a6 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 7 Aug 2012 07:57:27 -0400 Subject: [PATCH] added anyLoadByLoad function to Utils --- client.js | 27 +++++++++++++++++++++++++++ lib/client/editor.js | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/client.js b/client.js index b3063e61..5ac0c9a1 100644 --- a/client.js +++ b/client.js @@ -132,6 +132,33 @@ CloudClient.Util = (function(){ return lID.replace('.','_'); }, + + this.loadOnload = function(pFunc_a){ + if(Array.isArray(pFunc_a) && pFunc_a.length){ + var lFunc_f = pFunc_a.pop(); + + if(typeof lFunc_f === 'function') + lFunc_f(); + + return this.loadOnload(pFunc_a); + } + else if(typeof pFunc_a === 'function') + return pFunc_a(); + }; + + this.anyLoadOnload = function(pParams_a){ + if(Array.isArray(pParams_a) && pParams_a.length){ + var lParams_o = pParams_a.pop(); + + if(!lParams_o.func) + lParams_o.func = function(){ + lThis.anyLoadOnload(pParams_a); + }; + + return this.anyload(lParams_o); + } + }; + /* * Функция создаёт элемент и * загружает файл с src. diff --git a/lib/client/editor.js b/lib/client/editor.js index 9971685d..3cae9137 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -48,7 +48,7 @@ CloudCommander.Editor.CodeMirror.load = (function(pParent){ '}' }); - pParent.jsload('lib/client/editor/' + + pParent.jsload('lib/client/editor/' + 'codemirror/pack/javascript.pack.js', createEditorDiv); };