[ticket/12662] Fix rounding problems when detecting relative height

Firefox and IE round subpixels up, while webkit rounds down. So we have
to account for that.

PHPBB3-12662
This commit is contained in:
PayBas 2014-06-07 18:23:32 +02:00
parent 4a98d7e46d
commit f41947f726

View file

@ -543,7 +543,7 @@ function parse_document(container)
}
// Nothing to resize if block's height is not bigger than tallest element's height
if ($this.height() <= maxHeight) {
if ($this.height() <= (maxHeight + 1)) {
return;
}
@ -557,7 +557,7 @@ function parse_document(container)
compactMaxHeight = Math.max(compactMaxHeight, $(this).outerHeight(true));
});
if ($this.height() <= maxHeight) {
if ($this.height() <= (maxHeight + 1)) {
return;
}
@ -595,7 +595,7 @@ function parse_document(container)
item.css('display', '');
$this.addClass('responsive');
// Try to not hide filtered items #TODO: this does not work in FF and IE of some reason
// Try to not hide filtered items
if (filterLastList.length) {
links.not(filterLast).css('display', 'none');
@ -605,7 +605,7 @@ function parse_document(container)
maxHeight = Math.max(maxHeight, $(this).outerHeight(true));
});
if ($this.height() <= maxHeight) {
if ($this.height() <= (maxHeight + 1)) {
menu.children().filter(filterLast).css('display', 'none');
return;
}