From b329e1863b136e1beee949354980471fb1bf8e07 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Sun, 9 Sep 2012 05:02:49 -0400 Subject: [PATCH] fixed bug with height of CodeMirror --- css/style.css | 4 ++-- lib/client/editor.js | 36 +++++++++++++++++++----------------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/css/style.css b/css/style.css index a8a488f5..061bb7f5 100644 --- a/css/style.css +++ b/css/style.css @@ -92,7 +92,7 @@ body{ color:rgba(222, 41, 41, 0.81); } .refresh-icon{ - background:url(/img/panel_refresh.png) no-repeat; + background:url(/img/panel_refresh.png) no-repeat; } .refresh-icon:active{ /*background-position-y: -15px;*/ @@ -338,4 +338,4 @@ a:focus { outline: thin dotted; } #right{ display:none; } -} \ No newline at end of file +} \ No newline at end of file diff --git a/lib/client/editor.js b/lib/client/editor.js index 9e72e5ac..069431af 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -5,21 +5,21 @@ var CloudCommander, CloudFunc, CodeMirror; (function(){ "use strict"; var cloudcmd = CloudCommander; - var Util = cloudcmd.Util; - var KeyBinding = cloudcmd.KeyBinding; + var Util = CloudCommander.Util; + var KeyBinding = CloudCommander.KeyBinding; CloudCommander.Editor = { get : (function(){ return this.CodeMirror; }) }; - CloudCommander.Editor.CodeMirror = {}; + var Cloud_CodeMirror = {}; /* indicator says CodeMirror still loads */ - CloudCommander.Editor.CodeMirror.loading = false; + Cloud_CodeMirror.loading = false; /* function loads CodeMirror js and css files */ - CloudCommander.Editor.CodeMirror.load = (function(pCurrentFile, pIsReadOnly){ + Cloud_CodeMirror.load = (function(pCurrentFile, pIsReadOnly){ /* function shows editor */ var lThis = this; var createEditorDiv = function(){ @@ -48,28 +48,28 @@ var CloudCommander, CloudFunc, CodeMirror; Util.cssSet({id:'editor', - inner : '.CodeMirror{' + - 'font-family :\'Droid Sans Mono\';' + - 'font-size :15px;' + - 'padding :20px;' + - '}' + - '.CodeMirror-scroll{' + - 'height : 660px;' + + inner : '.CodeMirror{' + + 'font-family :\'Droid Sans Mono\';' + + 'font-size :15px;' + + 'padding :20px;' + + '}' + + '.CodeMirror-scroll{' + + 'height : ' + cloudcmd.HEIGHT + 'px' + '}' }); - Util.jsload('lib/client/editor/' + + Util.jsload('lib/client/editor/' + 'codemirror/mode/javascript.js', createEditorDiv); }; /* load CodeMirror main module */ - Util.jsload('lib/client/editor/' + + Util.jsload('lib/client/editor/' + 'codemirror/codemirror.js', loadAll); }); /* function shows CodeMirror editor */ - CloudCommander.Editor.CodeMirror.show = (function(pCurrentFile, pIsReadOnly){ + Cloud_CodeMirror.show = (function(pCurrentFile, pIsReadOnly){ /* if CloudEditor is not loaded - loading him */ var lCloudEditor = Util.getById('CloudEditor'); if(!lCloudEditor) @@ -167,7 +167,7 @@ var CloudCommander, CloudFunc, CodeMirror; }); /* function hides CodeMirror editor */ - CloudCommander.Editor.CodeMirror.hide = (function() { + Cloud_CodeMirror.hide = (function() { return function(){ KeyBinding.set(); Util.showPanel(); @@ -181,7 +181,7 @@ var CloudCommander, CloudFunc, CodeMirror; }; }); - CloudCommander.Editor.Keys = (function(pCurrentFile, pIsReadOnly){ + CloudCommander.Editor.Keys = (function(pCurrentFile, pIsReadOnly){ "use strict"; var lThis = this.CodeMirror; @@ -226,4 +226,6 @@ var CloudCommander, CloudFunc, CodeMirror; }; } }); + + CloudCommander.Editor.CodeMirror = Cloud_CodeMirror; })(); \ No newline at end of file