mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-18 18:10:43 +08:00
This commit is contained in:
parent
2ab5e5e709
commit
eded9cd936
@ -2321,7 +2321,7 @@ export class Gutter {
|
|||||||
if (isShow) {
|
if (isShow) {
|
||||||
type = nodeElement.getAttribute("data-type");
|
type = nodeElement.getAttribute("data-type");
|
||||||
}
|
}
|
||||||
const dataNodeId = nodeElement.getAttribute("data-node-id");
|
let dataNodeId = nodeElement.getAttribute("data-node-id");
|
||||||
if (type === "NodeAttributeView" && target) {
|
if (type === "NodeAttributeView" && target) {
|
||||||
const rowElement = hasClosestByClassName(target, "av__row");
|
const rowElement = hasClosestByClassName(target, "av__row");
|
||||||
if (rowElement && !rowElement.classList.contains("av__row--header")) {
|
if (rowElement && !rowElement.classList.contains("av__row--header")) {
|
||||||
@ -2354,6 +2354,7 @@ export class Gutter {
|
|||||||
if (!topElement.isSameNode(nodeElement) && type !== "NodeHeading") {
|
if (!topElement.isSameNode(nodeElement) && type !== "NodeHeading") {
|
||||||
nodeElement = topElement;
|
nodeElement = topElement;
|
||||||
type = nodeElement.getAttribute("data-type");
|
type = nodeElement.getAttribute("data-type");
|
||||||
|
dataNodeId = nodeElement.getAttribute("data-node-id");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (type === "NodeListItem" && index === 1 && !isShow) {
|
if (type === "NodeListItem" && index === 1 && !isShow) {
|
||||||
@ -2365,10 +2366,15 @@ export class Gutter {
|
|||||||
if (protyle.disabled) {
|
if (protyle.disabled) {
|
||||||
gutterTip = this.gutterTip.split("<br>").splice(0, 2).join("<br>");
|
gutterTip = this.gutterTip.split("<br>").splice(0, 2).join("<br>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let popoverHTML = ""
|
||||||
|
if (protyle.options.backlinkData) {
|
||||||
|
popoverHTML = `class="popover__block" data-id="${dataNodeId}"`
|
||||||
|
}
|
||||||
const buttonHTML = `<button class="ariaLabel" data-position="right" aria-label="${gutterTip}"
|
const buttonHTML = `<button class="ariaLabel" data-position="right" aria-label="${gutterTip}"
|
||||||
data-type="${type}" data-subtype="${nodeElement.getAttribute("data-subtype")}" data-node-id="${nodeElement.getAttribute("data-node-id")}">
|
data-type="${type}" data-subtype="${nodeElement.getAttribute("data-subtype")}" data-node-id="${dataNodeId}">
|
||||||
<svg><use xlink:href="#${getIconByType(type, nodeElement.getAttribute("data-subtype"))}"></use></svg>
|
<svg><use xlink:href="#${getIconByType(type, nodeElement.getAttribute("data-subtype"))}"></use></svg>
|
||||||
<span ${protyle.disabled ? "" : 'draggable="true"'}></span>
|
<span ${popoverHTML} ${protyle.disabled ? "" : 'draggable="true"'}></span>
|
||||||
</button>`;
|
</button>`;
|
||||||
if (isShow) {
|
if (isShow) {
|
||||||
html = buttonHTML + html;
|
html = buttonHTML + html;
|
||||||
|
Loading…
Reference in New Issue
Block a user