mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-04 17:06:35 +00:00
refactor: improve platform-specific button handling and streamline profile opening logic
This commit is contained in:
@@ -202,7 +202,7 @@ var gZenVerticalTabsManager = {
|
|||||||
get actualWindowButtons() {
|
get actualWindowButtons() {
|
||||||
// we have multiple ".titlebar-buttonbox-container" in the DOM, because of the titlebar
|
// we have multiple ".titlebar-buttonbox-container" in the DOM, because of the titlebar
|
||||||
if (!this.__actualWindowButtons) {
|
if (!this.__actualWindowButtons) {
|
||||||
this.__actualWindowButtons = AppConstants.platform === 'macosx' ?
|
this.__actualWindowButtons = (AppConstants.platform === 'macosx' || this.isWindowsStyledButtons) ?
|
||||||
document.querySelector('.titlebar-buttonbox-container') : // TODO: test if it works 100% of the time
|
document.querySelector('.titlebar-buttonbox-container') : // TODO: test if it works 100% of the time
|
||||||
document.querySelector('#nav-bar .titlebar-buttonbox-container');
|
document.querySelector('#nav-bar .titlebar-buttonbox-container');
|
||||||
}
|
}
|
||||||
|
@@ -49,11 +49,7 @@ var ZenProfileDialogUI = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_openProfile(profile) {
|
_openProfile(profile) {
|
||||||
SelectableProfileService.getProfile(
|
Services.startup.createInstanceWithProfile(profile);
|
||||||
aEvent.target.getAttribute("profileid")
|
|
||||||
).then(profile => {
|
|
||||||
SelectableProfileService.launchInstance(profile);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_getProfilesSize(profiles) {
|
_getProfilesSize(profiles) {
|
||||||
|
@@ -430,11 +430,11 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||||||
let activeWorkspace = await this.getActiveWorkspace();
|
let activeWorkspace = await this.getActiveWorkspace();
|
||||||
if (!activeWorkspace) {
|
if (!activeWorkspace) {
|
||||||
activeWorkspace = workspaces.workspaces.find((workspace) => workspace.default);
|
activeWorkspace = workspaces.workspaces.find((workspace) => workspace.default);
|
||||||
this.activeWorkspace = activeWorkspace.uuid;
|
this.activeWorkspace = activeWorkspace?.uuid;
|
||||||
}
|
}
|
||||||
if (!activeWorkspace) {
|
if (!activeWorkspace) {
|
||||||
activeWorkspace = workspaces.workspaces[0];
|
activeWorkspace = workspaces.workspaces[0];
|
||||||
this.activeWorkspace = activeWorkspace.uuid;
|
this.activeWorkspace = activeWorkspace?.uuid;
|
||||||
}
|
}
|
||||||
await this.changeWorkspace(activeWorkspace, true);
|
await this.changeWorkspace(activeWorkspace, true);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user