From 1bffa3033eb46cdfe197d98e46a9dfef29b59354 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 10 Sep 2012 11:11:49 -0400 Subject: [PATCH] improved borders over CodeMirror and panels --- ChangeLog | 3 +++ config.json | 2 +- css/style.css | 4 +++- lib/client/editor.js | 35 +++++++++++++++++++---------------- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index dd65f071..3565e261 100644 --- a/ChangeLog +++ b/ChangeLog @@ -31,6 +31,9 @@ Function scrollIntoViewIfNeeded was polyfilled. * Fixed bug with setting current file when mouse down. +* Improved borders over CodeMirror and panels thrue css. + + 2012.08.24, Version 0.1.6 * From now jsload, cssload and anyload suport arrays. diff --git a/config.json b/config.json index d58f0b2d..325b96e5 100644 --- a/config.json +++ b/config.json @@ -2,7 +2,7 @@ "cache" : {"allowed" : false}, "minification" : { "js" : false, - "css" : true, + "css" : false, "html" : true, "img" : true }, diff --git a/css/style.css b/css/style.css index 083a29df..a90d8af6 100644 --- a/css/style.css +++ b/css/style.css @@ -153,7 +153,7 @@ background:url(/img/panel_refresh.png) 0 -15px no-repeat; } #fm{ height: 90%; - margin: 10px; + margin: 26px; } .fm_header{ font-weight: bold; @@ -177,6 +177,8 @@ background:url(/img/panel_refresh.png) 0 -15px no-repeat; } .panel{ border: 1.5px solid rgba(49, 123, 249, .40); + /* remove default margins */ + margin: 0 0 0 0; overflow-y: auto; width:46%; } diff --git a/lib/client/editor.js b/lib/client/editor.js index c086caaa..06475a75 100644 --- a/lib/client/editor.js +++ b/lib/client/editor.js @@ -48,24 +48,23 @@ var CloudCommander, CloudFunc, CodeMirror; Util.cssSet({id:'editor', - inner : '.CodeMirror{' + - 'font-family :\'Droid Sans Mono\';' + - 'font-size :15px;' + - 'padding :20px;' + - 'border: 1.5px solid rgba(49, 123, 249, .40)'+ - '}' + - '.CodeMirror-scroll{' + - 'height : ' + cloudcmd.HEIGHT + 'px' + + inner : '.CodeMirror{' + + 'font-family :\'Droid Sans Mono\';' + + 'font-size :15px;' + + 'padding :20px 0 0 0;' + + '}' + + '.CodeMirror-scroll{' + + 'height : ' + (cloudcmd.HEIGHT-40) + '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); }); @@ -92,6 +91,7 @@ var CloudCommander, CloudFunc, CodeMirror; var lThis = this; var initCodeMirror_f = function(pValue){ + lCloudEditor.className = 'panel'; new CodeMirror(lCloudEditor,{ mode : 'javascript', value : pValue, @@ -173,12 +173,15 @@ var CloudCommander, CloudFunc, CodeMirror; KeyBinding.set(); Util.showPanel(); - var lCloudEditor = Util.getById('CloudEditor'); - var lCodeMirror = Util.getByClass('CodeMirror'); - - if(lCodeMirror.length) - lCloudEditor - .removeChild(lCodeMirror[0]); + var lCloudEditor = Util.getById('CloudEditor'); + if(lCloudEditor){ + lCloudEditor.className = 'hidden'; + var lCodeMirror = Util.getByClass('CodeMirror', lCloudEditor); + + if(lCodeMirror.length) + lCloudEditor + .removeChild(lCodeMirror[0]); + } }; });