fixed bug with open CodeMirror view from menu

This commit is contained in:
coderaiser 2012-08-24 10:53:03 -04:00
parent 0176f04af5
commit 7881ad2e4e
4 changed files with 24 additions and 10 deletions

View file

@ -1,7 +1,7 @@
{
"cache" : {"allowed" : true},
"cache" : {"allowed" : false},
"minification" : {
"js" : true,
"js" : false,
"css" : true,
"html" : true,
"img" : true

View file

@ -70,7 +70,8 @@ var CloudCommander, CloudFunc, CodeMirror;
/* function shows CodeMirror editor */
CloudCommander.Editor.CodeMirror.show = (function(pCurrentFile, pIsReadOnly){
/* if CloudEditor is not loaded - loading him */
if(!Util.getById('CloudEditor'))
var lCloudEditor = Util.getById('CloudEditor');
if(!lCloudEditor)
return this.load(pCurrentFile, pIsReadOnly);
/* if CodeMirror function show already
@ -104,9 +105,7 @@ var CloudCommander, CloudFunc, CodeMirror;
readOnly : lReadOnly
});
};
var lCloudEditor = Util.getById('CloudEditor');
var lA;
/* getting link */

View file

@ -51,8 +51,11 @@ var CloudCommander, $;
CloudCommander.Editor();
else{
var lEditor = CloudCommander.Editor.get();
if(lEditor && lEditor.show)
lEditor.show();
if(lEditor && lEditor.show){
var lCurrent = Util.getCurrentFile();
if(lCurrent)
lEditor.show();
}
}
}},

View file

@ -64,7 +64,7 @@ exports.Cache = {
*/
exports.Minify = {
/* pathes to directories */
INDEX :'index.html',
INDEX :'index.html',
/* приватный переключатель минимизации */
_allowed :{
css:true,
@ -106,7 +106,18 @@ exports.Minify = {
'without minify module\n' +
'npm i minify');
}
/*
* temporary changed dir path,
* becouse directory lib is write
* protected by others by default
* so if node process is started
* from other user (root for example
* in nodester) we can not write
* minified versions
*/
this.MinFolder = '/' + lMinify.MinFolder;
var lOptimizeParams = [];
if (this._allowed.js) {
lOptimizeParams.push('client.js');
@ -157,5 +168,6 @@ exports.Minify = {
},
/* minification folder name */
MinFolder : '',
Cache : {}
};