Skip to content

Commit

Permalink
Fix disappearing tabs on page zoom
Browse files Browse the repository at this point in the history
On Firefox, there is a 1 pixel difference on some page zoom levels (130%
and up) between an element's offset height/width and scroll
height/width. This causes the tabs to shrink when they should not.

Fixes #6597
  • Loading branch information
dmarcoux committed Dec 18, 2018
1 parent ee4292a commit 66c5f5a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/api/app/assets/javascripts/webui2/tabs.js
Expand Up @@ -27,7 +27,8 @@ function refreshTabs(tabList) {

$.fn.hasOverflow = function() {
var element = $(this)[0];
return (element.offsetHeight < element.scrollHeight) || (element.offsetWidth < element.scrollWidth);
// We must check that the scroll is bigger than the offset to shrink the tabs until needed (the 1 pixel difference is caused by a Firefox issue)
return (element.offsetHeight < element.scrollHeight - 1) || (element.offsetWidth < element.scrollWidth - 1);
};

$.fn.collapse = function(){
Expand Down

0 comments on commit 66c5f5a

Please sign in to comment.