Skip to content

Commit

Permalink
SAK-29037 setMainFrameHeight() has arbitrary maximum height
Browse files Browse the repository at this point in the history
  • Loading branch information
bjones86 committed Feb 3, 2015
1 parent 1111c3c commit acf6521
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions reference/library/src/webapp/js/headscripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,21 @@ function clickOnEnter(event, element)
}

// set the parent iframe's height to hold our entire contents
function setMainFrameHeight(id)
// pass -1 for no max
function setMainFrameHeightWithMax(id, maxHeight)
{
if ( ! inIframe() ) return;
// some browsers need a moment to finish rendering so the height and scroll are correct
setTimeout("setMainFrameHeightNow('"+id+"')",1);
setTimeout("setMainFrameHeightNow('"+id+"',"+maxHeight+")", 1);
}

function setMainFrameHeight(id)
{
setMainFrameHeightWithMax(id, 32760); // original default max height for resizing the frame, reason unknown
}

function setMainFrameHeightNow(id)
// pass -1 for no max
function setMainFrameHeightNow(id, maxHeight)
{
// If we have been inlined, do nothing
if ( ! inIframe() ) return;
Expand Down Expand Up @@ -305,7 +312,7 @@ function setMainFrameHeightNow(id)
var newHeight = height + 40;

// but not too big!
if (newHeight > 32760) newHeight = 32760;
if (maxHeight > -1 && newHeight > maxHeight) newHeight = maxHeight;

// capture my current scroll position
var scroll = findScroll();
Expand Down

0 comments on commit acf6521

Please sign in to comment.