Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add option to open in new window by default #1266

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions addon/src/_locales/en/messages.json
Original file line number Diff line number Diff line change
@@ -99,6 +99,10 @@
"message": "Open \"Manage Groups\" in new tab",
"description": "Open \"Manage Groups\" in new tab"
},
"openGroupsInNewWindow": {
"message": "Always open groups in new window",
"description": "Always open groups in new window"
},
"showConfirmDialogBeforeGroupDelete": {
"message": "Show confirmation dialog before deleting the group",
"description": "Show confirmation dialog before deleting the group"
1 change: 1 addition & 0 deletions addon/src/js/constants.js
Original file line number Diff line number Diff line change
@@ -281,6 +281,7 @@ export const DEFAULT_OPTIONS = Object.freeze({
alwaysAskNewGroupName: true,
createNewGroupWhenOpenNewWindow: false,
openManageGroupsInTab: true,
openGroupsInNewWindow: false,
showConfirmDialogBeforeGroupArchiving: true,
showConfirmDialogBeforeGroupDelete: true,
showNotificationAfterGroupDelete: true,
6 changes: 6 additions & 0 deletions addon/src/options/Options.vue
Original file line number Diff line number Diff line change
@@ -735,6 +735,12 @@
<span v-text="lang('openManageGroupsInTab')"></span>
</label>
</div>
<div class ="field">
<label class="checkbox">
<input v-model="options.openGroupsInNewWindow" type="checkbox" />
<span v-text="lang('openGroupsInNewWindow')"></span>
</label>
</div>
<div class="field">
<label class="checkbox">
<input v-model="options.showConfirmDialogBeforeGroupDelete" type="checkbox" />
17 changes: 13 additions & 4 deletions addon/src/popup/Popup.vue
Original file line number Diff line number Diff line change
@@ -952,10 +952,12 @@
} else {
this.someGroupAreLoading = true;

let loadGroupPromise = Messages.sendMessage('load-custom-group', {
groupId: group.id,
tabId: tab?.id,
});
// Open group in current window, or in new window if openGroupsInNewWindow (settings) is enabled
if (this.options.openGroupsInNewWindow) {
let loadGroupPromise = this.openGroupInNewWindow(group, tab);
} else {
let loadGroupPromise = this.openGroupInThisWindow(group, tab);
}

if (!isSidebar && this.options.closePopupAfterSelectTab && tab) {
this.someGroupAreLoading = false;
@@ -1038,6 +1040,13 @@
});
},

openGroupInThisWindow(group, tab) {
Messages.sendMessage('load-custom-group', {
groupId: group.id,
tabId: tab?.id,
});
},

openGroupSettings(group) {
this.groupToEdit = group;
},