mirror of
https://github.com/zen-browser/components.git
synced 2025-07-08 04:09:59 +02:00
Refactor ZenSidebarManager to handle drag enter event properly
This commit is contained in:
parent
5c9edb195a
commit
9a1dcde549
2 changed files with 8 additions and 3 deletions
|
@ -290,6 +290,9 @@ var gZenBrowserManagerSidebar = {
|
||||||
_handleDragOver(event) {},
|
_handleDragOver(event) {},
|
||||||
|
|
||||||
_handleDragEnter(event) {
|
_handleDragEnter(event) {
|
||||||
|
if (typeof this.__dragingElement === 'undefined') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const target = event.target;
|
const target = event.target;
|
||||||
const elIndex = Array.prototype.indexOf.call(target.parentNode.children, target);
|
const elIndex = Array.prototype.indexOf.call(target.parentNode.children, target);
|
||||||
if (elIndex < this.__dragingIndex) {
|
if (elIndex < this.__dragingIndex) {
|
||||||
|
|
|
@ -823,11 +823,13 @@ var ZenWorkspaces = {
|
||||||
},
|
},
|
||||||
|
|
||||||
getContextIdIfNeeded(userContextId) {
|
getContextIdIfNeeded(userContextId) {
|
||||||
if (typeof userContextId !== 'undefined' || !this.workspaceEnabled) {
|
const activeWorkspace = this.getActiveWorkspaceFromCache();
|
||||||
|
const activeWorkspaceUserContextId = activeWorkspace?.containerTabId;
|
||||||
|
if ((typeof userContextId !== 'undefined' && userContextId !== activeWorkspaceUserContextId)
|
||||||
|
|| !this.workspaceEnabled) {
|
||||||
return [userContextId, false];
|
return [userContextId, false];
|
||||||
}
|
}
|
||||||
const activeWorkspace = this.getActiveWorkspaceFromCache();
|
return [activeWorkspaceUserContextId, true];
|
||||||
return [activeWorkspace?.containerTabId, true];
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue