Vanessa 2023-11-30 22:05:23 +08:00
parent 004bc16b59
commit e0e44f6677
4 changed files with 26 additions and 1 deletions

View file

@ -146,6 +146,24 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
return true;
}
const addTabElement = hasClosestByAttribute(event.target, "data-type", "av-add");
if (addTabElement) {
const id = Lute.NewNodeID();
const avID = blockElement.getAttribute("data-av-id");
transaction(protyle, [{
action: "addAttrViewView",
avID,
id
}], [{
action: "removeAttrViewView",
avID,
id
}]);
event.preventDefault();
event.stopPropagation();
return true;
}
const linkElement = hasClosestByClassName(event.target, "av__celltext--url");
if (linkElement) {
let linkAddress = linkElement.textContent.trim();

View file

@ -210,6 +210,10 @@ ${cell.color ? `color:${cell.color};` : ""}">${text}</div>`;
<div class="av__header">
<div class="layout-tab-bar fn__flex">
${tabHTML}
<div class="fn__space"></div>
<span data-type="av-add" class="block__icon block__icon--show">
<svg><use xlink:href="#iconAdd"></use></svg>
</span>
<div class="fn__flex-1"></div>
${response.data.isMirror ? ` <span class="block__icon block__icon--show b3-tooltips b3-tooltips__w" aria-label="${window.siyuan.languages.mirrorTip}">
<svg><use xlink:href="#iconSplitLR"></use></svg></span><div class="fn__space"></div>` : ""}