Refactor ZenSidebarManager to handle drag enter event properly

This commit is contained in:
mauro-balades 2024-09-22 17:49:16 +02:00
parent 5c9edb195a
commit 9a1dcde549
2 changed files with 8 additions and 3 deletions

View file

@ -290,6 +290,9 @@ var gZenBrowserManagerSidebar = {
_handleDragOver(event) {},
_handleDragEnter(event) {
if (typeof this.__dragingElement === 'undefined') {
return;
}
const target = event.target;
const elIndex = Array.prototype.indexOf.call(target.parentNode.children, target);
if (elIndex < this.__dragingIndex) {

View file

@ -823,11 +823,13 @@ var ZenWorkspaces = {
},
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];
}
const activeWorkspace = this.getActiveWorkspaceFromCache();
return [activeWorkspace?.containerTabId, true];
return [activeWorkspaceUserContextId, true];
},
};