mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
added loading image when file going to be edited
This commit is contained in:
parent
1dc17522a2
commit
c01dc90226
4 changed files with 53 additions and 32 deletions
|
|
@ -84,17 +84,36 @@ CloudCommander.Editor.CodeMirror = {
|
|||
|
||||
var lCurrent = this.getByClass(lCURRENTFILE);
|
||||
var lA;
|
||||
if(lCurrent.length)
|
||||
lA = lCurrent[0].getElementsByTagName('a');
|
||||
|
||||
if(lA.length)
|
||||
lA = lA[0].href;
|
||||
if(lCurrent.length){
|
||||
lCurrent = lCurrent[0];
|
||||
|
||||
lA = lCurrent.getElementsByTagName('a');
|
||||
|
||||
if(lA.length)
|
||||
lA = lA[0].href;
|
||||
}
|
||||
|
||||
/* показываем гиф загрузки возле пути папки сверху*/
|
||||
var lLoadingImage = CloudCommander._images.loading();
|
||||
var lErrorImage = CloudCommander._images.error();
|
||||
|
||||
lLoadingImage.className='icon loading';/* показываем загрузку*/
|
||||
lErrorImage.className='icon error hidden';/* прячем ошибку */
|
||||
/* show loading icon */
|
||||
lCurrent.firstChild.nextSibling.appendChild(lLoadingImage);
|
||||
|
||||
/* reading data from current file */
|
||||
$.ajax({
|
||||
url:lA,
|
||||
error: function(jqXHR, textStatus, errorThrown){
|
||||
console.log(textStatus+' : '+ errorThrown);
|
||||
lErrorImage.className ='icon error';
|
||||
lErrorImage.title = jqXHR.responseText;
|
||||
|
||||
lCurrent.firstChild.nextSibling.appendChild(lErrorImage);
|
||||
|
||||
lLoadingImage.className ='hidden';
|
||||
|
||||
console.log(jqXHR.responseText);
|
||||
},
|
||||
|
||||
success:function(data, textStatus, jqXHR){
|
||||
|
|
@ -104,6 +123,8 @@ CloudCommander.Editor.CodeMirror = {
|
|||
|
||||
lLeft &&
|
||||
(lLeft.className = 'panel hidden');
|
||||
|
||||
lLoadingImage.className ='hidden';
|
||||
}
|
||||
});
|
||||
}),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue