Skip to content

Commit

Permalink
Prefer to use configs.autoAttachOnNewTabCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Jan 16, 2024
1 parent 4bbf936 commit 5e52a43
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions webextensions/sidebar/mouse-event-listener.js
Original file line number Diff line number Diff line change
Expand Up @@ -1070,11 +1070,14 @@ function onNewTabActionSelect(item, event) {
break;
case 'child':
const hints = new Set([
configs.autoAttachOnNewTabCommand,
configs.autoAttachOnNewTabButtonMiddleClick,
configs.autoAttachOnNewTabButtonAccelClick,
]);
if (hints.has(Constants.kNEWTAB_OPEN_AS_CHILD_TOP))
if (configs.autoAttachOnNewTabCommand == Constants.kNEWTAB_OPEN_AS_CHILD_TOP)
action = Constants.kNEWTAB_OPEN_AS_CHILD_TOP;
else if (configs.autoAttachOnNewTabCommand == Constants.kNEWTAB_OPEN_AS_CHILD_END)
action = Constants.kNEWTAB_OPEN_AS_CHILD_END;
else if (hints.has(Constants.kNEWTAB_OPEN_AS_CHILD_TOP))
action = Constants.kNEWTAB_OPEN_AS_CHILD_TOP;
else if (hints.has(Constants.kNEWTAB_OPEN_AS_CHILD_END))
action = Constants.kNEWTAB_OPEN_AS_CHILD_END;
Expand Down

0 comments on commit 5e52a43

Please sign in to comment.