diff --git a/controller/main.php b/controller/main.php index 155e7637..eace3248 100644 --- a/controller/main.php +++ b/controller/main.php @@ -28,7 +28,7 @@ class main /** * Template object - * @var \phpbb\template + * @var \phpbb\template\template */ protected $template; @@ -87,7 +87,7 @@ class main * @param \board3\portal\portal\columns $portal_columns Board3 Portal columns object * @param \phpbb\config\config $config phpBB Config object * @param \board3\portal\controller\helper $controller_helper Controller helper - * @param \phpbb\template $template Template object + * @param \phpbb\template\template $template Template object * @param \phpbb\user $user User object * @param \phpbb\path_helper $path_helper phpBB path helper * @param string $phpbb_root_path phpBB root path diff --git a/styles/prosilver/template/portal/assets/portal.js b/styles/prosilver/template/portal/assets/portal.js index 4bcd9af0..662383e8 100644 --- a/styles/prosilver/template/portal/assets/portal.js +++ b/styles/prosilver/template/portal/assets/portal.js @@ -24,17 +24,20 @@ phpbb.b3p_fix_right_column_margin = function() { var $portal_center = $('#portal-center'); if (width <= (895 - $.getScrollbarWidth())) { - // Get height of left and center column - var right_height = $portal_right.height(); - var left_height = $portal_left.height(); // Get correct margin-left for portal-right and add 10px for padding - $portal_right.css('margin-left', - ($portal_right.width() + 1)); - $portal_center.css('margin-top', Math.max(left_height, right_height) + 'px'); + if ($portal_left.width() > 0) { + $portal_right.css('margin-left', - ($portal_right.width() + 1)); + $portal_right.css('margin-top', $portal_center.height() + 'px'); + $portal_left.css('margin-top', $portal_center.height() + 'px'); + } else { + $portal_right.css('margin-left', 0); + $portal_right.css('margin-top', 0); + } } else { $portal_right.css('margin-top', '0px'); - $portal_right.css('margin-left', -$portal_left.width()); - $portal_right.width($portal_left.width()); - $portal_center.css('margin-top', 0); + $portal_right.css('margin-left', -portal_right_width); + $portal_right.width(portal_right_width); + $portal_left.css('margin-top', 0); } };