From be51681cae479e826811254e15c91950c72841c8 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 17 Feb 2014 15:06:07 +0000 Subject: [PATCH] let height callback know if called for an iframe or div, and add 120px for iframe in Pixelegg template to get ride of scroll bars --- pixelegg/js/slider.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pixelegg/js/slider.js b/pixelegg/js/slider.js index 7fd8752eb1..ea33736406 100644 --- a/pixelegg/js/slider.js +++ b/pixelegg/js/slider.js @@ -123,8 +123,15 @@ egw_LAB.wait(function() { }); - // Override jdots height calcluation - egw_fw.prototype.getIFrameHeight = function() + /** + * Callback to calculate height of browser iframe or div + * + * Override jdots height calcluation + * + * @param {object} _iframe dom node of iframe or null for div + * @returns number in pixel + */ + egw_fw.prototype.getIFrameHeight = function(iframe) { $header = $j(this.tabsUi.appHeaderContainer); var content = $j(this.tabsUi.activeTab.contentDiv); @@ -133,6 +140,9 @@ egw_LAB.wait(function() { - $header.outerHeight() - $j(this.tabsUi.contHeaderDiv).outerHeight() - (content.outerHeight(true) - content.height()) // Not sure where this comes from... + 5; + // can only avoid scrollbar for iframe, if I add here 120px + if (iframe) height += 120; + //console.log("getIFrameHeight("+iframe+") returning "+height+(iframe?' (iframe)':'')); return height; };