chore: Refactor ZenWorkspaces to use _createNewTabForWorkspace method for preparing new workspace

This commit is contained in:
Mauro Balades
2024-07-13 21:03:14 +02:00
parent 0a34fb4fb0
commit b0c036e72b
5 changed files with 12 additions and 12 deletions

View File

@@ -166,11 +166,7 @@ var ZenWorkspaces = {
_prepareNewWorkspace(window) {
document.documentElement.setAttribute("zen-workspace-id", window.uuid);
for (let tab of gBrowser.tabs) {
if (!tab.getAttribute("zen-workspace-id")) {
tab.setAttribute("zen-workspace-id", window.uuid);
}
}
this._createNewTabForWorkspace(window);
},
_createNewTabForWorkspace(window) {

View File

@@ -79,7 +79,12 @@
<panel id="PanelUI-zen-workspaces" position="bottomright topright" mainview="true" side="left">
<vbox>
<vbox>
<h3 data-l10n-id="zen-panel-ui-current-window-text"></h3>
<hbox>
<h3 data-l10n-id="zen-panel-ui-current-window-text"></h3>
<hbox class="translations-panel-beta" role="image" aria-label="Beta">
<image class="translations-panel-beta-icon"></image>
</hbox>
</hbox>
<html:div id="PanelUI-zen-workspaces-current-info">
</html:div>
</vbox>
@@ -88,6 +93,8 @@
<html:div id="PanelUI-zen-workspaces-list">
</html:div>
</vbox>
<toolbarbutton id="PanelUI-zen-workspaces-new" oncommand="ZenWorkspaces.createAndSaveWorkspace();" class="subviewbutton" data-l10n-id="zen-panel-ui-workspaces-new"></toolbarbutton>
<toolbarbutton id="PanelUI-zen-workspaces-new" oncommand="ZenWorkspaces.createAndSaveWorkspace();" class="subviewbutton">
<image></image>
</toolbarbutton>
</vbox>
</panel>

View File

@@ -2,7 +2,3 @@
zen-panel-ui-current-window-text = Current Window
zen-panel-ui-workspaces-text = Other Workspaces
zen-panel-ui-workspaces-new
.label = New Workspace
.accesskey = N

View File

@@ -154,7 +154,7 @@
#appMenu-zoomEnlarge-button2,
#PanelUI-zen-profiles-newProfile,
#zen-sidebar-add-panel-button,
#PanelUI-zen-workspaces-new {
#PanelUI-zen-workspaces-new image {
list-style-image: url("plus.svg") !important;
}

View File

@@ -310,6 +310,7 @@
#PanelUI-zen-workspaces-new {
position: absolute;
top: 10px;
min-height: 1px !important;
right: 10px;
padding: 3px;
border-radius: 4px;