93 | | eTargetDocument.write( '<html><head>' + sBase + '<script type="text/javascript"> var adjust = function() { window.frameElement.height = document.body.scrollHeight ; }; window.onresize = adjust; window.onload = function () {window.setTimeout( adjust, 0 );}</script></head><body style="overflow: hidden">' + document.getElementById( 'xToolbarSpace' ).innerHTML + '</body></html>' ) ; |
| 93 | eTargetDocument.write( '<html><head>' + sBase + '<script type="text/javascript"> var adjust = function() { window.frameElement.height = document.body.scrollHeight ; }; window.onresize = adjust; ' |
| 94 | + 'window.onload = function(){' // poll scrollHeight until it no longer changes for 1 sec. |
| 95 | + 'var timer = null;' |
| 96 | + 'var lastHeight = -1;' |
| 97 | + 'var lastChange = 0;' |
| 98 | + 'var poller = function(){' |
| 99 | + 'var currentHeight = document.body.scrollHeight || 0;' |
| 100 | + 'var currentTime = (new Date()).getTime();' |
| 101 | + 'if (currentHeight != lastHeight){' |
| 102 | + 'lastChange = currentTime;' |
| 103 | + 'adjust();' |
| 104 | + 'lastHeight = document.body.scrollHeight;' |
| 105 | + '}' |
| 106 | + 'if (lastChange < currentTime - 1000) clearInterval(timer);' |
| 107 | + '};' |
| 108 | + 'timer = setInterval(poller, 100);' |
| 109 | + '}' |
| 110 | + '</script></head><body style="overflow: hidden">' + document.getElementById( 'xToolbarSpace' ).innerHTML + '</body></html>' ) ; |