summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJan-Christoph Borchardt <jan@unhosted.org>2012-04-14 18:56:55 +0200
committerJan-Christoph Borchardt <jan@unhosted.org>2012-04-14 18:56:55 +0200
commitfbb314ef4b980500af270c1a58577f32a5de8b48 (patch)
tree4727dadf86fc177392248ef9538a25b92988191d /core
parentf16cfbab5e7800adb94bf5c7978ab1fe16b6fc78 (diff)
parent3b71e46cf7ab7affda761adca59fa368ec1a2fdc (diff)
downloadnextcloud-server-fbb314ef4b980500af270c1a58577f32a5de8b48.tar.gz
nextcloud-server-fbb314ef4b980500af270c1a58577f32a5de8b48.zip
Merge branch 'master' of gitorious.org:owncloud/owncloud
Diffstat (limited to 'core')
-rw-r--r--core/js/js.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/js/js.js b/core/js/js.js
index 7e8ca6164c6..e3941fba6d5 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -297,7 +297,10 @@ function object(o) {
* Fills height of window. (more precise than height: 100%;)
*/
function fillHeight(selector) {
- var height = parseFloat($(window).height())-parseFloat(selector.css('top'));
+ 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');
@@ -307,8 +310,11 @@ function fillHeight(selector) {
* 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())-parseFloat(selector.css('left'));
+ 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');