diff --git a/styles/prosilver/template/portal/assets/jquery.getscrollbarwidth.js b/styles/prosilver/template/portal/assets/jquery.getscrollbarwidth.js new file mode 100644 index 00000000..5ad38582 --- /dev/null +++ b/styles/prosilver/template/portal/assets/jquery.getscrollbarwidth.js @@ -0,0 +1,31 @@ +/*! Copyright (c) 2008 Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net) + * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) + * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. + */ + +/** + * Gets the width of the OS scrollbar + */ +(function($) { + var scrollbarWidth = 0; + $.getScrollbarWidth = function() { + if ( !scrollbarWidth ) { + if ( $.browser.msie ) { + var $textarea1 = $('') + .css({ position: 'absolute', top: -1000, left: -1000 }).appendTo('body'), + $textarea2 = $('') + .css({ position: 'absolute', top: -1000, left: -1000 }).appendTo('body'); + scrollbarWidth = $textarea1.width() - $textarea2.width(); + $textarea1.add($textarea2).remove(); + } else { + var $div = $('
') + .css({ width: 100, height: 100, overflow: 'auto', position: 'absolute', top: -1000, left: -1000 }) + .prependTo('body').append('
').find('div') + .css({ width: '100%', height: 200 }); + scrollbarWidth = 100 - $div.width(); + $div.parent().remove(); + } + } + return scrollbarWidth; + }; +})(jQuery); diff --git a/styles/prosilver/template/portal/modules/jquery_easing_1_3.js b/styles/prosilver/template/portal/assets/jquery_easing_1_3.js similarity index 100% rename from styles/prosilver/template/portal/modules/jquery_easing_1_3.js rename to styles/prosilver/template/portal/assets/jquery_easing_1_3.js diff --git a/styles/prosilver/template/portal/portal.js b/styles/prosilver/template/portal/assets/portal.js similarity index 57% rename from styles/prosilver/template/portal/portal.js rename to styles/prosilver/template/portal/assets/portal.js index 9152d250..5a640462 100644 --- a/styles/prosilver/template/portal/portal.js +++ b/styles/prosilver/template/portal/assets/portal.js @@ -19,17 +19,22 @@ var portal_right_width; */ phpbb.b3p_fix_right_column_margin = function() { var width = $(window).width(); + var $portal_right = $('#portal-right'); + var $portal_left = $('#portal-left'); + var $portal_center = $('#portal-center'); - if (width <= 880) { + if (width <= 895) { // Get height of left and center column - var center_height = $('#portal-center').outerHeight(); - var left_height = $('#portal-left').outerHeight(); - - $('#portal-right').css('margin-top', -(center_height - left_height) + 'px'); - $('#portal-right').width($('#portal-left').width()); + 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'); } else { - $('#portal-right').css('margin-top', '0px'); - $('#portal-right').width(portal_right_width); + $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); } }; diff --git a/styles/prosilver/template/portal/modules/portal_clock.js b/styles/prosilver/template/portal/assets/portal_clock.js similarity index 100% rename from styles/prosilver/template/portal/modules/portal_clock.js rename to styles/prosilver/template/portal/assets/portal_clock.js