mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-19 09:24:51 +00:00
minor changes
This commit is contained in:
parent
ccfb64a900
commit
13de3ae930
1 changed files with 15 additions and 17 deletions
|
|
@ -4,23 +4,21 @@ var CloudCommander, CodeMirror;
|
|||
*/
|
||||
CloudCommander.Editor = {};
|
||||
CloudCommander.Editor.CodeMirror = {
|
||||
load: (function(){ /* function loads CodeMirror js and css files */
|
||||
load: (function(pParent){ /* function loads CodeMirror js and css files */
|
||||
|
||||
/* function shows editor */
|
||||
var createEditorDiv = function(pParent){
|
||||
return function(){
|
||||
if (!document.getElementById('CloudEditor')) {
|
||||
var lEditor=document.createElement('div');
|
||||
lEditor.id ='CloudEditor';
|
||||
var lFM = document.getElementById('fm');
|
||||
|
||||
if(lFM){
|
||||
lFM.appendChild(lEditor);
|
||||
}else console.log('Error. Something went wrong FM not found');
|
||||
|
||||
pParent.show();
|
||||
}
|
||||
};
|
||||
var createEditorDiv = function(){
|
||||
if (!document.getElementById('CloudEditor')) {
|
||||
var lEditor=document.createElement('div');
|
||||
lEditor.id ='CloudEditor';
|
||||
var lFM = document.getElementById('fm');
|
||||
|
||||
if(lFM){
|
||||
lFM.appendChild(lEditor);
|
||||
}else console.log('Error. Something went wrong FM not found');
|
||||
|
||||
pParent.show();
|
||||
}
|
||||
};
|
||||
/* function loads css files
|
||||
* of CodeMirror
|
||||
|
|
@ -51,7 +49,7 @@ CloudCommander.Editor.CodeMirror = {
|
|||
});
|
||||
|
||||
CloudCommander.jsload('lib/client/editor/codemirror/pack/xml.pack.js',
|
||||
createEditorDiv(this));
|
||||
createEditorDiv);
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -62,7 +60,7 @@ CloudCommander.Editor.CodeMirror = {
|
|||
show : (function(){ /* function shows CodeMirror editor */
|
||||
/* if CloudEditor is not loaded - loading him */
|
||||
if(!document.getElementById('CloudEditor'))
|
||||
return this.load();
|
||||
return this.load(this);
|
||||
/* removing keyBinding if set */
|
||||
CloudCommander.keyBinded = false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue