From cf3af3f002ab58b90f8605e9271363601dc2eaf5 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 30 Jul 2012 05:49:35 -0400 Subject: [PATCH] minor changes --- lib/client/editor.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/lib/client/editor.js b/lib/client/editor.js index ac04bdb2..9070941a 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -7,17 +7,19 @@ CloudCommander.Editor.CodeMirror = { load: (function(){ /* function loads CodeMirror js and css files */ /* function shows editor */ - 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); - this.show(); - }else console.log('Error. Something went wrong FM not found'); - } + 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); + this.show(); + }else console.log('Error. Something went wrong FM not found'); + } + }; }; /* function loads css files * of CodeMirror @@ -48,7 +50,7 @@ CloudCommander.Editor.CodeMirror = { }); CloudCommander.jsload('lib/client/editor/codemirror/pack/xml.pack.js', - createEditorDiv); + createEditorDiv(this)); }; };