# HG changeset patch # User hertzhaft # Date 1297610552 -3600 # Node ID a34686e7c1517096468adef73c855cd37ee2124d # Parent 62c3b902f8785ff1f6c7d187539b1167f6fb0ac1 better height calculation, too diff -r 62c3b902f878 -r a34686e7c151 client/digitallibrary/jquery/jquery.digilib.js --- a/client/digitallibrary/jquery/jquery.digilib.js Sun Feb 13 16:16:42 2011 +0100 +++ b/client/digitallibrary/jquery/jquery.digilib.js Sun Feb 13 16:22:32 2011 +0100 @@ -911,17 +911,19 @@ var winH = $win.height(); var winW = $win.width(); var $body = $('body'); - // include standard body margin - var bodyB = $body.outerWidth(true) - $body.width(); + // include standard body margins + var borderW = $body.outerWidth(true) - $body.width(); + var borderH = $body.outerHeight(true) - $body.height(); // get width of first button div var buttonsW = 0; if (data.$buttonSets) { buttonsW = data.$buttonSets[0].outerWidth(); } // account for left/right border, body margins and additional requirements - var calcW = winW - bodyB - buttonsW - data.settings.scalerInset; - console.debug(winW, winH, 'winW:', $win.width(), 'bodyBorder:', bodyB, 'buttonsW:', buttonsW, 'calc:', calcW); - return geom.size(calcW, winH); + var calcW = winW - borderW - buttonsW - data.settings.scalerInset; + var calcH = winH - borderH; + console.debug(winW, winH, 'winW:', $win.width(), 'border:', borderW, 'buttonsW:', buttonsW, 'calc:', calcW); + return geom.size(calcW, calcH); }; // creates HTML structure for digilib in elem