mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-24 01:06:09 +01:00
This commit is contained in:
parent
77541b7dda
commit
d45741e33f
1 changed files with 13 additions and 10 deletions
|
|
@ -61,6 +61,19 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
|
||||||
return true;
|
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) {
|
if (protyle.disabled) {
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -267,16 +280,6 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
return true;
|
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;
|
target = target.parentElement;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue