From de213782913179a793fba48f3cf8f3843a4207eb Mon Sep 17 00:00:00 2001 From: Marvin Thomas Rabe Date: Tue, 4 Oct 2011 18:54:07 +0200 Subject: fixed scrollbar issues --- core/css/styles.css | 2 +- core/js/js.js | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/css/styles.css b/core/css/styles.css index d51bd0896ea..2d78c174978 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -53,7 +53,7 @@ input[type="submit"].highlight{ background:#ffc100; border:1px solid #db0; text- #controls { width:100%; top:3.5em; height:2.8em; margin:0; background:#f7f7f7; border-bottom:1px solid #eee; position:fixed; z-index:50; -moz-box-shadow:0 -3px 7px #000; -webkit-box-shadow:0 -3px 7px #000; box-shadow:0 -3px 7px #000; } #controls .button { display:inline-block; } #content { margin:3.5em 0 0 12.5em; } -#leftcontent, .leftcontent { position:absolute; top:6.4em; width:20em; background:#f8f8f8; height:100%; border-right:1px solid #ddd; } +#leftcontent, .leftcontent { position:fixed; overflow: auto; top:6.4em; width:20em; background:#f8f8f8; border-right:1px solid #ddd; } #leftcontent li, .leftcontent li { padding:.3em .8em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; -webkit-transition:background-color 500ms; -moz-transition:background-color 500ms; -o-transition:background-color 500ms; transition:background-color 500ms; } #leftcontent li:hover, #leftcontent li:active, #leftcontent li.active, .leftcontent li:hover, .leftcontent li:active, .leftcontent li.active { background:#eee; } #rightcontent, .rightcontent { position:absolute; top:6.4em; left:33em; } diff --git a/core/js/js.js b/core/js/js.js index 61a60c52485..9e814ca0729 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -244,7 +244,36 @@ function object(o) { return new F(); } + +/** + * Fills height of window. (more precise than height: 100%;) + */ +function fillHeight(selector) { + var height = parseFloat($(window).height())-parseFloat(selector.css('top')); + selector.css('height', height + 'px'); + if(selector.outerHeight() > selector.height()) + selector.css('height', height-(selector.outerHeight()-selector.height()) + 'px'); +} + +/** + * Fills height and width of window. (more precise than height: 100%; or width: 100%;) + */ +function fillWindow(selector) { + fillHeight(selector); + var width = parseFloat($(window).width())-parseFloat(selector.css('left')); + selector.css('width', width + 'px'); + if(selector.outerWidth() > selector.width()) + selector.css('width', width-(selector.outerWidth()-selector.width()) + 'px'); +} + $(document).ready(function(){ + + $(window).resize(function () { + fillHeight($('#leftcontent')); + fillWindow($('#rightcontent')); + }); + $(window).trigger('resize'); + if(!SVGSupport()){//replace all svg images with png images for browser that dont support svg replaceSVG(); }else{ -- cgit v1.2.3