[Pkg-mozext-commits] [tabmixplus] 08/13: Follow up bug 1365780 - Consistently dispatch the TabAttrModified event and update the title bar when setting tab labels
David Prévot
taffit at moszumanska.debian.org
Sat Aug 5 15:28:28 UTC 2017
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to tag 0.5.0.4pre.170525a1
in repository tabmixplus.
commit 62012b523bdc4548d2c0d66cecb0c8966474fb9e
Author: onemen <tabmix.onemen at gmail.com>
Date: Tue May 23 15:46:01 2017 +0300
Follow up bug 1365780 - Consistently dispatch the TabAttrModified event and update the title bar when setting tab labels
---
chrome/content/minit/tablib.js | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/chrome/content/minit/tablib.js b/chrome/content/minit/tablib.js
index 1e19354..a696a27 100644
--- a/chrome/content/minit/tablib.js
+++ b/chrome/content/minit/tablib.js
@@ -303,8 +303,8 @@ Tabmix.tablib = {
Tabmix.changeCode(gBrowser, "gBrowser.getWindowTitleForBrowser")._replace(
'if (!docTitle)',
- 'let tab = this.getTabForBrowser(aBrowser);\
- if (tab.hasAttribute("tabmix_changed_label"))\
+ (Tabmix.isVersion(550) ? '' : 'let tab = this.getTabForBrowser(aBrowser);\n') +
+ 'if (tab.hasAttribute("tabmix_changed_label"))\
docTitle = tab.getAttribute("tabmix_changed_label");\
else\
docTitle = TMP_Places.getTabTitle(tab, aBrowser.currentURI.spec, docTitle);\
@@ -337,7 +337,7 @@ Tabmix.tablib = {
'$&\
urlTitle = title;'
)._replace(
- 'if (aTab.label == title',
+ Tabmix.isVersion(550) ? 'return this._setTabLabel' : 'if (aTab.label == title',
'if (aTab.hasAttribute("mergeselected"))\
title = "(*) " + title;\
const noChange = aTab.label == title && (Tabmix.isVersion(530) || aTab.crop == crop);\
@@ -352,9 +352,22 @@ Tabmix.tablib = {
)._replace(
'this._tabAttrModified',
`Tabmix.tablib.onTabTitleChanged(aTab, browser, title == urlTitle);
- $&`
+ $&`, {check: !Tabmix.isVersion(550)}
+ )._replace(
+ '{ isContentTitle }',
+ '{ isContentTitle, urlTitle }',
+ {check: Tabmix.isVersion(550)}
).toCode();
+ if (Tabmix.isVersion(550)) {
+ Tabmix.changeCode(gBrowser, "gBrowser._setTabLabel")._replace(
+ 'this._tabAttrModified',
+ `let urlTitle = aOptions && aOptions.urlTitle;
+ Tabmix.tablib.onTabTitleChanged(aTab, aTab.linkedBrowser, aLabel == urlTitle);
+ $&`
+ ).toCode();
+ }
+
// after bug 347930 - change Tab strip to be a toolbar
Tabmix.changeCode(gBrowser, "gBrowser.setStripVisibilityTo")._replace(
'this.tabContainer.visible = aShow;',
--
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