fixed bug with CodeMirror ajax error processing

This commit is contained in:
coderaiser 2012-07-31 10:54:58 -04:00
parent 8a1f4f047c
commit 18e69efd99
2 changed files with 5 additions and 7 deletions

View file

@ -58,8 +58,7 @@ CloudCommander.Editor.CodeMirror = {
/* if CloudEditor is not loaded - loading him */
if(!document.getElementById('CloudEditor'))
return this.load(this);
/* removing keyBinding if set */
CloudCommander.keyBinded = false;
/* removing keyBinding if set */
var lParent = this;
var initCodeMirror_f = function(pValue){
@ -94,16 +93,15 @@ CloudCommander.Editor.CodeMirror = {
/* reading data from current file */
$.ajax({
url:lA,
error: function(jqXHR, textStatus, errorThrown){
console.log(textStatus+' : '+ errorThrown);
return false;
console.log(textStatus+' : '+ errorThrown);
},
success:function(data, textStatus, jqXHR){
initCodeMirror_f(data);
CloudCommander.keyBinded = false;
lLeft &&
(lLeft.className = 'panel hidden');
}

View file

@ -284,7 +284,7 @@ CloudCommander.keyBinding=(function(){
/* добавляем обработчик клавишь */
if(document.addEventListener)
document.addEventListener('keydown', key_event,false);
else document.onkeypress=key_event;
else document.onkeypress = key_event;
/* клавиши назначены*/
CloudCommander.keyBinded=true;
});