Bug 1908431 - add basic support for tab groups in overflow menu. r=dao,fluent-reviewers,desktop-theme-reviewers,tabbrowser-reviewers,bolsson
Differential Revision: https://phabricator.services.mozilla.com/D232389
This commit is contained in:
@@ -138,6 +138,15 @@
|
||||
this.#updateLabelAriaAttributes();
|
||||
}
|
||||
|
||||
// alias for label
|
||||
get name() {
|
||||
return this.label;
|
||||
}
|
||||
|
||||
set name(newName) {
|
||||
this.label = newName;
|
||||
}
|
||||
|
||||
get collapsed() {
|
||||
return this.hasAttribute("collapsed");
|
||||
}
|
||||
@@ -224,6 +233,19 @@
|
||||
on_TabSelect() {
|
||||
this.collapsed = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* If one of this group's tabs is the selected tab, this will do nothing.
|
||||
* Otherwise, it will expand the group if collapsed, and select the first
|
||||
* tab in its list.
|
||||
*/
|
||||
select() {
|
||||
this.collapsed = false;
|
||||
if (gBrowser.selectedTab.group == this) {
|
||||
return;
|
||||
}
|
||||
gBrowser.selectedTab = this.tabs[0];
|
||||
}
|
||||
}
|
||||
|
||||
customElements.define("tab-group", MozTabbrowserTabGroup);
|
||||
|
||||
Reference in New Issue
Block a user