[Pkg-mozext-commits] [tabmixplus] 65/147: Keep closed tabs menu width when it stay open

David Prévot taffit at moszumanska.debian.org
Sat Aug 5 15:27:37 UTC 2017


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository tabmixplus.

commit 8f96ed0e2cb08abfa5b0f4e64cc5a80252064a4b
Author: onemen <tabmix.onemen at gmail.com>
Date:   Tue Dec 13 20:33:39 2016 +0200

    Keep closed tabs menu width when it stay open
---
 chrome/content/session/sessionStore.js | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/chrome/content/session/sessionStore.js b/chrome/content/session/sessionStore.js
index ec86144..d371018 100644
--- a/chrome/content/session/sessionStore.js
+++ b/chrome/content/session/sessionStore.js
@@ -340,10 +340,15 @@ var TMP_ClosedTabs = {
     return val;
   },
 
-  populateUndoSubmenu: function ct_populateUndoSubmenu(aPopup) {
+  populateUndoSubmenu: function ct_populateUndoSubmenu(aPopup, keepWidth) {
     if (TabmixAllTabs.isAfterCtrlClick(aPopup.parentNode))
       return false;
 
+    if (keepWidth && !aPopup.hasAttribute("width")) {
+      const width = aPopup.getBoundingClientRect().width;
+      aPopup.setAttribute("width", width);
+    }
+
     TabmixAllTabs.beforeCommonList(aPopup, true);
 
     // populate menu
@@ -444,7 +449,7 @@ var TMP_ClosedTabs = {
       this.keepMenuOpen = !this.keepMenuOpen;
       const image = this.keepMenuOpen ? "chrome://tabmixplus/skin/pin.png" : "";
       item.setAttribute("image", image);
-      this.populateUndoSubmenu(item.parentNode);
+      this.populateUndoSubmenu(item.parentNode, true);
       return;
     }
 
@@ -482,7 +487,7 @@ var TMP_ClosedTabs = {
     const rePopulate = (keepMenuOpen || this.keepMenuOpen) && this.count > 0;
     if (rePopulate) {
       if (popup && command == "restoreTab") {
-        this.populateUndoSubmenu(popup);
+        this.populateUndoSubmenu(popup, true);
       }
     } else if (item.getAttribute("closemenu") == "none") {
       closeMenus(popup);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/tabmixplus.git



More information about the Pkg-mozext-commits mailing list