Skip to content

Commit

Permalink
Use more meaningful name
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed May 7, 2024
1 parent 74a20d4 commit c399c12
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion webextensions/common/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ export const configs = new Configs({
showTabDragBehaviorNotification: true,
guessDraggedNativeTabs: true,
ignoreTabDropNearSidebarArea: true,
allowDropParentToDescendant: true,
moveSoloTabOnDropParentToDescendant: true,

fixupTreeOnTabVisibilityChanged: false,
fixupOrderOfTabsFromOtherDevice: true,
Expand Down
6 changes: 3 additions & 3 deletions webextensions/sidebar/drag-and-drop.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ function getDropAction(event) {
if (info.draggedTab.windowId != TabsStore.getCurrentWindowId()) {
return true;
}
if (!configs.allowDropParentToDescendant &&
if (!configs.moveSoloTabOnDropParentToDescendant &&
info.parent?.id == info.draggedTab.id) {
log('canDrop:undroppable: drop on child');
return false;
Expand All @@ -274,7 +274,7 @@ function getDropAction(event) {
log('canDrop:undroppable: on dragging multiselected tabs');
return false;
}
if (configs.allowDropParentToDescendant)
if (configs.moveSoloTabOnDropParentToDescendant)
return true;
const ancestors = info.dragOverTab.$TST.ancestors;
/* too many function call in this way, so I use alternative way for better performance.
Expand Down Expand Up @@ -1339,7 +1339,7 @@ function sanitizeDraggedTabs({ draggedTabs, structure, insertBefore, insertAfter
const parentId = parent?.id;
log('sanitizeDraggedTabs: ', () => ({ draggedTabs: draggedTabs.map(dumpTab), structure, insertBefore: dumpTab(insertBefore), insertAfter: dumpTab(insertAfter), parentId, isCopy }));
if (isCopy ||
!configs.allowDropParentToDescendant ||
!configs.moveSoloTabOnDropParentToDescendant ||
draggedTabs.every(tab => tab.id != parentId))
return { draggedTabs, structure, insertBefore, insertAfter };

Expand Down

0 comments on commit c399c12

Please sign in to comment.