diff --git a/lib/client/editor.js b/lib/client/editor.js index ef8ca39a..5d11fc76 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -54,7 +54,8 @@ CloudCommander.Editor.CodeMirror = { }; /* load CodeMirror main module */ - CloudCommander.jsload('lib/client/editor/codemirror/pack/codemirror.pack.js', loadAll(this)); + CloudCommander.jsload('lib/client/editor/codemirror/pack/codemirror.pack.js', + loadAll(this)); }), show : (function(){ /* function shows CodeMirror editor */ @@ -67,12 +68,24 @@ CloudCommander.Editor.CodeMirror = { var lLeft = this.getById('left'); var lCloudEditor = this.getById('CloudEditor'); + var lCurrent = this.getById(CloudCommander.CURRENCURRENT_FILE); + var lA; + if(lCurrent.length) + lA = lCurrent.getElementsByTagName('a'); + + if(lA.length) + lA = lA[0].href; + + var lValue = $.ajax(lA); + if(lValue.responseText) + lValue = lValue.responseText; + lLeft && (lLeft.className = 'panel hidden'); CodeMirror(lCloudEditor,{ mode : 'xml', - value : '', + value : lValue, theme : 'night', lineNumbers : true, //переносим длинные строки