diff --git a/lib/client/editor.js b/lib/client/editor.js index f2c245cb..23cd0fd6 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -15,7 +15,8 @@ CloudCommander.Editor.CodeMirror = { var lFM = document.getElementById('fm'); if(lFM){ - lFM.appendChild(lEditor); + lFM.appendChild(lEditor); + this.show(); }else console.log('Error. Something went wrong FM not found'); } }; @@ -57,10 +58,10 @@ CloudCommander.Editor.CodeMirror = { CloudCommander.jsload('lib/client/editor/codemirror/pack/codemirror.pack.js', loadAll(this)); }), - show : (function(pParent){ /* function shows CodeMirror editor */ + show : (function(){ /* function shows CodeMirror editor */ /* if CloudEditor is not loaded - loading him */ - document.getElementById('CloudEditor') || - this.load(); + if(!document.getElementById('CloudEditor')) + return this.load(); /* removing keyBinding if set */ CloudCommander.keyBinded = false; @@ -80,7 +81,7 @@ CloudCommander.Editor.CodeMirror = { lineWrapping: true, extraKeys: { //Сохранение - "Esc": pParent.hide(pParent) + "Esc": this.hide(this) } });