mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-02 19:00:15 +01:00
This commit is contained in:
parent
004bc16b59
commit
e0e44f6677
4 changed files with 26 additions and 1 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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>` : ""}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue