minor changes

This commit is contained in:
coderaiser 2012-07-30 05:52:06 -04:00
parent ccfb64a900
commit 13de3ae930

View file

@ -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;