setted readOnly mode, when directory opened in CodeMirror

This commit is contained in:
coderaiser 2012-08-06 06:05:57 -04:00
parent 18841e7fd0
commit 035f6d2dfd

View file

@ -75,7 +75,13 @@ CloudCommander.Editor.CodeMirror.show = (function(){
if(this.loading)
return;
var lParent = this;
/* when folder view
* is no need to edit
* data
*/
var lReadOnly = false;
var lParent = this;
var initCodeMirror_f = function(pValue){
CodeMirror(lCloudEditor,{
mode : 'javascript',
@ -84,11 +90,12 @@ CloudCommander.Editor.CodeMirror.show = (function(){
lineNumbers : true,
//переносим длинные строки
lineWrapping: false,
autofocus : true,
autofocus : true,
extraKeys: {
//Сохранение
"Esc": lParent.hide(lParent)
}
},
readOnly : lReadOnly
});
};
@ -123,8 +130,10 @@ CloudCommander.Editor.CodeMirror.show = (function(){
*/
if (lSize === '<dir>'){
if (lA.indexOf(CloudFunc.NOJS) ===
CloudFunc.FS.length){
lA = lA.replace(CloudFunc.NOJS, '');
CloudFunc.FS.length) {
lA = lA.replace(CloudFunc.NOJS, '');
lReadOnly = true;
}
}
}