diff options
author | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2012-10-31 18:52:13 +0100 |
---|---|---|
committer | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2012-10-31 18:52:13 +0100 |
commit | f50c043cfbd149beadc5b14c79b42baead9713ca (patch) | |
tree | 5676ea46c20b0731811ec2dc713ef340443f95ca /core/js/js.js | |
parent | 3db43a9980049c80d9f3cd2cf510b8a527189ded (diff) | |
parent | c4b8bb10411a4d601b7f4c8758980005f14850ab (diff) | |
download | nextcloud-server-f50c043cfbd149beadc5b14c79b42baead9713ca.tar.gz nextcloud-server-f50c043cfbd149beadc5b14c79b42baead9713ca.zip |
Merge branch 'navigation' of github.com:owncloud/core into navigation
Diffstat (limited to 'core/js/js.js')
-rw-r--r-- | core/js/js.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/core/js/js.js b/core/js/js.js index 40c26d0011f..790fe4dcb3f 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -468,6 +468,36 @@ function object(o) { return new F(); } +/** + * Fills height of window. (more precise than height: 100%;) + */ +function fillHeight(selector) { + if (selector.length === 0) { + return; + } + var height = parseFloat($(window).height())-selector.offset().top; + selector.css('height', height + 'px'); + if(selector.outerHeight() > selector.height()){ + selector.css('height', height-(selector.outerHeight()-selector.height()) + 'px'); + } + console.warn("This function is deprecated! Use CSS instead"); +} + +/** + * Fills height and width of window. (more precise than height: 100%; or width: 100%;) + */ +function fillWindow(selector) { + if (selector.length === 0) { + return; + } + fillHeight(selector); + var width = parseFloat($(window).width())-selector.offset().left; + selector.css('width', width + 'px'); + if(selector.outerWidth() > selector.width()){ + selector.css('width', width-(selector.outerWidth()-selector.width()) + 'px'); + } + console.warn("This function is deprecated! Use CSS instead"); +} $(document).ready(function(){ |