fixed vertical scroll issue with editor, thanks LightDot

This commit is contained in:
mdipierro
2013-06-10 21:29:46 -05:00
parent a2a1e95c96
commit 4a24523c10
3 changed files with 8 additions and 11 deletions
+5 -9
View File
@@ -109,17 +109,14 @@ jQuery(document).on('click', '#themes a', function (e) {
return window.innerHeight || (document.documentElement || document.body).clientHeight;
}
function setFullScreen(instance, full) {
var wrap = instance.getWrapperElement(), scroll = instance.getScrollerElement();
var wrap = instance.getWrapperElement()
if (full) {
wrap.className += " CodeMirror-fullscreen";
jQuery(wrap).css('width', "100%");
jQuery(wrap).css('position', "absolute");
scroll.style.height = winHeight() + "px";
wrap.style.height = winHeight() + "px";
document.documentElement.style.overflow = "hidden";
} else {
wrap.className = wrap.className.replace(" CodeMirror-fullscreen", "");
jQuery(wrap).css('position', "relative");
scroll.style.height = "";
wrap.style.height = "";
document.documentElement.style.overflow = "";
}
instance.refresh();
@@ -127,8 +124,7 @@ jQuery(document).on('click', '#themes a', function (e) {
CodeMirror.on(window, "resize", function() {
var showing = document.body.getElementsByClassName("CodeMirror-fullscreen")[0];
if (!showing) return;
console.log('CodeMirror.connect()',winHeight() );
showing.CodeMirror.getScrollerElement().style.height = winHeight() + "px";
showing.CodeMirror.getWrappererElement().style.height = winHeight() + "px";
});
{{if len(request.args) > 1:}}
@@ -168,7 +164,7 @@ jQuery(document).on('click', '#themes a', function (e) {
{{for dir in dirs:}}
<li class="nav-header component" onclick="collapse('{{="%s_files" % dir['name']}}');">{{=dir['name']}}</li>
<li id="{{="%s_files" % dir['name']}}">
<ul class="nav nav-list">
<ul class="nav nav-list small-font">
{{for f in listfiles(app, dir['name'], regexp=dir['reg'] ):}}
{{id="%s__" % dir['name'] + f.replace('.','__')}}
{{current_file = request.args(len(request.args) - 1)}}