Bug 1554630 - fix tab overflow for tambail-tab. r=mkmelin
authorAlessandro Castellani <alessandro@thunderbird.net>
Mon, 01 Jul 2019 13:18:10 -0700
changeset 36008 66aa32e146d4feb2164363028380ea2a11935daf
parent 36007 fe454c1cff8402bde8a5b625a977aeef95f54217
child 36009 c1649b46c7a37900587f35ef9cc352bafa71b824
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersmkmelin
bugs1554630
Bug 1554630 - fix tab overflow for tambail-tab. r=mkmelin
mail/base/content/tabmail-tabs.js
--- a/mail/base/content/tabmail-tabs.js
+++ b/mail/base/content/tabmail-tabs.js
@@ -609,21 +609,44 @@
       this.arrowScrollboxClosebutton.collapsed = this.mCloseButtons != 3;
     }
 
     _handleTabSelect() {
       this.arrowScrollbox.ensureElementIsVisible(this.selectedItem);
     }
 
     handleEvent(aEvent) {
+      let alltabsButton = document.getElementById("alltabs-button");
+
       switch (aEvent.type) {
         case "overflow":
           this.arrowScrollbox.ensureElementIsVisible(this.selectedItem);
+
+          // filter overflow events which were dispatched on nested scrollboxes
+          if (aEvent.target != this.arrowScrollbox)
+            return;
+
+          // Ignore vertical events.
+          if (aEvent.detail == 0)
+            return;
+
+          this.arrowScrollbox.removeAttribute("notoverflowing");
+          alltabsButton.removeAttribute("hidden");
           break;
         case "underflow":
+          // filter underflow events which were dispatched on nested scrollboxes
+          if (aEvent.target != this.arrowScrollbox)
+            return;
+
+          // Ignore vertical events.
+          if (aEvent.detail == 0)
+            return;
+
+          this.arrowScrollbox.setAttribute("notoverflowing", "true");
+          alltabsButton.setAttribute("hidden", "true");
           break;
         case "resize":
           let width = this.arrowScrollbox.getBoundingClientRect().width;
           if (width != this.arrowScrollboxWidth) {
             this._updateCloseButtons();
             // XXX without this line the tab bar won't budge
             this.arrowScrollbox.scrollByPixels(1);
             this._handleTabSelect();