fixed bug with position of error image

This commit is contained in:
coderaiser 2012-08-19 05:08:43 -04:00
parent a0726fa984
commit f7da1ac3bc
2 changed files with 21 additions and 18 deletions

View file

@ -70,10 +70,11 @@ body{
margin-left:0.5%;
}
.error::before{
bottom : 4px;
content:'\f026';
cursor:default;
color:rgb(222, 41, 41);
position: relative;
position: relative;
}
.loading{
background:url(/img/spinner.gif);

View file

@ -65,16 +65,16 @@ CloudCommander.Editor.CodeMirror.load = (function(pThis){
});
/* function shows CodeMirror editor */
CloudCommander.Editor.CodeMirror.show = (function(pThis, pIsReadOnly){
CloudCommander.Editor.CodeMirror.show = (function(pIsReadOnly){
/* if CloudEditor is not loaded - loading him */
if(!pThis.getById('CloudEditor'))
return pThis.load(pThis);
if(!this.getById('CloudEditor'))
return this.load(this);
/* if CodeMirror function show already
* called do not call it again
* if f4 key pressed couple times
*/
if(pThis.loading)
if(this.loading)
return;
/* when folder view
@ -83,6 +83,8 @@ CloudCommander.Editor.CodeMirror.show = (function(pThis, pIsReadOnly){
*/
var lReadOnly = pIsReadOnly || false;
var lThis = this;
var initCodeMirror_f = function(pValue){
CodeMirror(lCloudEditor,{
mode : 'javascript',
@ -94,19 +96,19 @@ CloudCommander.Editor.CodeMirror.show = (function(pThis, pIsReadOnly){
autofocus : true,
extraKeys: {
//Сохранение
"Esc": pThis.hide(pThis)
"Esc": lThis.hide(lThis)
},
readOnly : lReadOnly
});
};
var lCloudEditor = pThis.getById('CloudEditor');
var lCloudEditor = this.getById('CloudEditor');
var lCurrent = pThis.getCurrentFile();
var lCurrent = this.getCurrentFile();
var lA;
/* getting link */
lA = pThis.getByTag('a', lCurrent);
lA = this.getByTag('a', lCurrent);
lA = lA[0].href;
@ -114,7 +116,7 @@ CloudCommander.Editor.CodeMirror.show = (function(pThis, pIsReadOnly){
lA = '/' + lA.replace(document.location.href,'');
/* checking is this link is to directory */
var lSize = pThis.getByClass('size', lCurrent);
var lSize = this.getByClass('size', lCurrent);
if(lSize){
lSize = lSize[0].textContent;
@ -132,16 +134,16 @@ CloudCommander.Editor.CodeMirror.show = (function(pThis, pIsReadOnly){
this.loading = true;
setTimeout(function(){
pThis.loading = false;},
lThis.loading = false;},
400);
/* reading data from current file */
$.ajax({
url:lA,
error: (function(jqXHR, textStatus, errorThrown){
pThis.loading = false;
lThis.loading = false;
return pThis.Images.showError(jqXHR);
return lThis.Images.showError(jqXHR);
}),
success:function(data, textStatus, jqXHR){
@ -154,10 +156,10 @@ CloudCommander.Editor.CodeMirror.show = (function(pThis, pIsReadOnly){
/* removing keyBinding if set */
CloudCommander.keyBinded = false;
pThis.hidePanel();
pThis.Images.hideLoad();
lThis.hidePanel();
lThis.Images.hideLoad();
pThis.loading = false;
lThis.loading = false;
}
});
});
@ -195,9 +197,9 @@ CloudCommander.Editor.Keys = (function(pIsReadOnly){
if(!pEvent.shiftKey){
if(pEvent.keyCode === lF4)
lShow(lThis);
lShow();
else if(pEvent.keyCode === lF3){
lShow(lThis, true);
lShow(true);
}
}
}