Skip to content

Commit

Permalink
🎨 fix #10609
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Mar 14, 2024
1 parent 77541b7 commit d45741e
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions app/src/protyle/render/av/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,19 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
return true;
}

const viewItemElement = hasClosestByClassName(event.target, "item");
if (viewItemElement && viewItemElement.parentElement.classList.contains("layout-tab-bar")) {
if (viewItemElement.classList.contains("item--focus")) {
openViewMenu({protyle, blockElement, element: viewItemElement});
} else {
blockElement.removeAttribute("data-render");
avRender(blockElement, protyle, undefined, viewItemElement.dataset.id);
}
event.preventDefault();
event.stopPropagation();
return true;
}


if (protyle.disabled) {
return false;
Expand Down Expand Up @@ -267,16 +280,6 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
event.preventDefault();
event.stopPropagation();
return true;
} else if (target.classList.contains("item") && target.parentElement.classList.contains("layout-tab-bar")) {
if (target.classList.contains("item--focus")) {
openViewMenu({protyle, blockElement, element: target});
} else {
blockElement.removeAttribute("data-render");
avRender(blockElement, protyle, undefined, target.dataset.id);
}
event.preventDefault();
event.stopPropagation();
return true;
}
target = target.parentElement;
}
Expand Down

0 comments on commit d45741e

Please sign in to comment.