chore: Reformat ZenWorkspaces.mjs

This commit is contained in:
Jivan Flores 2024-09-12 21:48:05 -07:00
parent 89f28b307d
commit 82814b4c9a

View file

@ -102,7 +102,7 @@ var ZenWorkspaces = {
// Convert all the icons to just the first character, just in case someone // Convert all the icons to just the first character, just in case someone
// decides to use a string with more than one character // decides to use a string with more than one character
_kIcons: JSON.parse(Services.prefs.getStringPref("zen.workspaces.icons")).map((icon) => icon[0]), _kIcons: JSON.parse(Services.prefs.getStringPref('zen.workspaces.icons')).map((icon) => icon[0]),
_initializeWorkspaceCreationIcons() { _initializeWorkspaceCreationIcons() {
let container = document.getElementById('PanelUI-zen-workspaces-create-icons-container'); let container = document.getElementById('PanelUI-zen-workspaces-create-icons-container');
@ -243,8 +243,8 @@ var ZenWorkspaces = {
(container) => container.userContextId === workspace.containerTabId (container) => container.userContextId === workspace.containerTabId
); );
if (containerGroup) { if (containerGroup) {
element.classList.add("identity-color-" + containerGroup.color); element.classList.add('identity-color-' + containerGroup.color);
element.setAttribute("data-usercontextid", containerGroup.userContextId); element.setAttribute('data-usercontextid', containerGroup.userContextId);
} }
let childs = window.MozXULElement.parseXULToFragment(` let childs = window.MozXULElement.parseXULToFragment(`
<div class="zen-workspace-icon"> <div class="zen-workspace-icon">
@ -605,9 +605,7 @@ var ZenWorkspaces = {
async contextChangeContainerTab(event) { async contextChangeContainerTab(event) {
let workspaces = await this._workspaces(); let workspaces = await this._workspaces();
let workspace = workspaces.workspaces.find((workspace) => workspace.uuid === this._contextMenuId); let workspace = workspaces.workspaces.find((workspace) => workspace.uuid === this._contextMenuId);
let userContextId = parseInt( let userContextId = parseInt(event.target.getAttribute('data-usercontextid'));
event.target.getAttribute("data-usercontextid")
);
workspace.containerTabId = userContextId; workspace.containerTabId = userContextId;
await this.saveWorkspace(workspace); await this.saveWorkspace(workspace);
await this._propagateWorkspaceData(); await this._propagateWorkspaceData();
@ -684,7 +682,7 @@ var ZenWorkspaces = {
// Tab browser utilities // Tab browser utilities
getContextIdIfNeeded(userContextId) { getContextIdIfNeeded(userContextId) {
if (typeof userContextId !== "undefined" || !this.workspaceEnabled) { if (typeof userContextId !== 'undefined' || !this.workspaceEnabled) {
return [userContextId, false]; return [userContextId, false];
} }
const activeWorkspace = this.getActiveWorkspaceFromCache(); const activeWorkspace = this.getActiveWorkspaceFromCache();