Documents: Fix iframe height calculation in safari BT#18486

pull/3830/head
Julio Montoya 5 years ago
parent 5438e23735
commit d62cc4ee0d
  1. 12
      main/document/showinframes.php

@ -237,7 +237,11 @@ if (!$playerSupported && $execute_iframe) {
// Fixes the content height of the frame // Fixes the content height of the frame
$(function() { $(function() {
$(\'#mainFrame\').on(\'load\', function () { $(\'#mainFrame\').on(\'load\', function () {
this.style.height = (this.contentWindow.document.body.scrollHeight + 50) + \'px\'; let currentHeight = this.style.height;
let frameHeight = this.contentWindow.document.body.scrollHeight + 50;
if (frameHeight > currentHeight) {
this.style.height = frameHeight + \'px\';
}
}); });
'.$frameReady.' '.$frameReady.'
@ -419,10 +423,12 @@ if ($execute_iframe) {
name="mainFrame" name="mainFrame"
border="0" border="0"
frameborder="0" frameborder="0"
marginheight="0"
marginwidth="0"
scrolling="no" scrolling="no"
style="width:100%;" height="600" style="width:100%; height=600px"
src="'.$file_url_web.'&rand='.mt_rand(1, 10000).'" src="'.$file_url_web.'&rand='.mt_rand(1, 10000).'"
height="500" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>'; allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"></iframe>';
} }
} }
Display::display_footer(); Display::display_footer();

Loading…
Cancel
Save