Skip to content

Commit

Permalink
Find closebox element correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Jul 19, 2023
1 parent 78efcf0 commit 5750303
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions webextensions/sidebar/drag-and-drop.js
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ function onDragStart(event, options = {}) {
mLastDragEnteredTarget = tab.$TST.element;
const startOnClosebox = mDragTargetIsClosebox = mousedown.detail.closebox;
if (startOnClosebox)
mLastDragEnteredTarget = tab.$TST.element.closeBoxElement;
mLastDragEnteredTarget = tab.$TST.element.closeBox;
const windowId = TabsStore.getCurrentWindowId();
const treeItem = new TSTAPI.TreeItem(tab);
TSTAPI.sendMessage({
Expand Down Expand Up @@ -1590,7 +1590,7 @@ function onTSTAPIDragEnter(event) {
return;
let target = tab.$TST.element;
if (mDragTargetIsClosebox && EventUtils.isEventFiredOnClosebox(event))
target = tab.$TST.element.closeBoxElement;
target = tab.$TST.element.closeBox;
cancelDelayedTSTAPIDragExitOn(target);
if (tab &&
(!mDragTargetIsClosebox ||
Expand Down Expand Up @@ -1618,10 +1618,11 @@ function onTSTAPIDragExit(event) {
return;
let target = tab.$TST.element;
if (mDragTargetIsClosebox && EventUtils.isEventFiredOnClosebox(event))
target = tab.$TST.element.closeBoxElement;
target = tab.$TST.element.closeBox;
cancelDelayedTSTAPIDragExitOn(target);
target.onTSTAPIDragExitTimeout = setTimeout(() => {
delete target.onTSTAPIDragExitTimeout;
if (target)
delete target.onTSTAPIDragExitTimeout;
const treeItem = new TSTAPI.TreeItem(tab);
TSTAPI.sendMessage({
type: TSTAPI.kNOTIFY_TAB_DRAGEXIT,
Expand Down

0 comments on commit 5750303

Please sign in to comment.