From b5e7dc1c9dbd8dd618c9b92ffad2208fe4b0d8bb Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 3 Aug 2012 16:31:40 +0300 Subject: [PATCH] add function showLoad to Util object --- client.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/client.js b/client.js index 6d93cf1e..5ff73ff0 100644 --- a/client.js +++ b/client.js @@ -310,8 +310,23 @@ CloudClient.Util = (function(){ (lCurrent = lCurrent[0].parentElement); return lCurrent && lCurrent.id; - } + }, + this.showLoad = function(){ + var lCurrent = this.getByClass(CloudCommander.CURRENT_FILE); + if(lCurrent.length){ + lCurrent = lCurrent[0]; + + var lLoadingImage = CloudCommander._images.loading(); + lLoadingImage.className = 'icon loading';/* показываем загрузку*/ + + /* show loading icon * + * if it not showed */ + var lCurrent = lCurrent.firstChild.nextSibling; + if(lCurrent !== lLoadingImage.parentElement) + appendChild(lLoadingImage); + } + } }); @@ -325,7 +340,7 @@ CloudClient.keyBinding=(function(){ }); /* function loads and shows editor */ -CloudClient.Editor = (function(){ +CloudClient.Editor = (function(){ /* loading CloudMirror plagin */ Util.jsload(CloudClient.LIBDIRCLIENT + 'editor.js',{