Editor now 100% h+w using CSS, JS only on height

Width and height now 100% rather then 100px
This is to avoid occasional issues with non resizing on login
No longer setting the width, no need
(Could also leave the height to 100% but it's only as high as the no of
lines in the document, looks a bit weird)
This commit is contained in:
Matt Pass
2012-07-21 14:11:12 +01:00
parent 91e30ef9bd
commit 57fd479a9c
2 changed files with 6 additions and 8 deletions

View File

@@ -18,8 +18,8 @@ foldcode, searchcursor, match-highlighter
<script src="<?php echo $ICEcoder["codeMirrorDir"]; ?>/lib/codemirror-compressed.js"></script>
<link rel="stylesheet" href="<?php echo $ICEcoder["theme"]=="default" ? 'lib/editor.css' : '{$ICEcoder["codeMirrorDir"]}/theme/{$ICEcoder["theme"]}.css';?>">
<style type="text/css">
.CodeMirror {position: absolute; width: 0; background-color: #fff; top: 0px; width: 100px; z-index: 1}
.CodeMirror-scroll {height: 100px;}
.CodeMirror {position: absolute; width: 0; background-color: #fff; top: 0px; width: 100%; z-index: 1}
.CodeMirror-scroll {height: 100%}
.cm-s-activeLine {background: #000 !important;}
span.CodeMirror-matchhighlight {background: #555}
.CodeMirror-focused span.CodeMirror-matchhighlight {color: #000; background: #555; !important}
@@ -30,7 +30,7 @@ span.CodeMirror-matchhighlight {background: #555}
<body onLoad="top.ICEcoder.updateFileFolderCount()" style="color: #fff; margin: 0" onKeyDown="return top.ICEcoder.interceptKeys('content', event);" onKeyUp="top.ICEcoder.resetKeys(event);">
<div style="margin: 32px 43px; font-family: arial; font-size: 10px; color: #dddddd">
<div style="margin: 32px 43px; font-family: arial; font-size: 10px; color: #ddd">
<?php if($_SESSION['userLevel'] == 10) {
echo '<div style="float: left; margin-right: 50px">'.PHP_EOL;
echo '<h2 style="color: rgba(0,198,255,0.7)">server</h2>'.PHP_EOL;

View File

@@ -92,13 +92,11 @@ var ICEcoder = {
cMCSS = ICEcoder.content.contentWindow.document.styleSheets[2];
cMCSS.rules ? strCSS = 'rules' : strCSS = 'cssRules';
for(var i=0;i<cMCSS[strCSS].length;i++) {
if(cMCSS[strCSS][i].selectorText==".CodeMirror") {
cMCSS[strCSS][i].style['width'] = ICEcoder.content.style.width;
}
if(cMCSS[strCSS][i].selectorText==".CodeMirror-scroll") {
cMCSS[strCSS][i].style['height'] = ICEcoder.content.style.height;
}
}
}
},
@@ -503,7 +501,7 @@ var ICEcoder = {
},
// Determine which area of the document we're in
caretLocationType: function () {
caretLocationType: function() {
var cM, caretLocType, caretChunk, fileName;
cM = ICEcoder.getcMInstance();
@@ -575,7 +573,7 @@ var ICEcoder = {
}
if (ICEcoder.openFiles.length>0 && ICEcoder.selectedTab==0) {ICEcoder.selectedTab=1};
// hide the content area if we have no tabs open
// grey out the view icon
if (ICEcoder.openFiles.length==0) {
top.ICEcoder.fMIconVis('fMView',0.3);
} else {