mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 08:48:49 +01:00
🎨 https://github.com/siyuan-note/siyuan/issues/15388 分组行重复时块标高亮错位
This commit is contained in:
parent
96346a94ad
commit
d7aa181eb9
2 changed files with 5 additions and 3 deletions
|
|
@ -2299,15 +2299,16 @@ export class Gutter {
|
|||
const rowElement = hasClosestByClassName(target, "av__row");
|
||||
if (rowElement && !rowElement.classList.contains("av__row--header")) {
|
||||
element = rowElement;
|
||||
const bodyElement = hasClosestByClassName(rowElement, "av__body") as HTMLElement;
|
||||
let iconAriaLabel = isMac() ? window.siyuan.languages.rowTip : window.siyuan.languages.rowTip.replace("⇧", "Shift+");
|
||||
if (protyle.disabled) {
|
||||
iconAriaLabel = window.siyuan.languages.rowTip.substring(0, window.siyuan.languages.rowTip.indexOf("<br"));
|
||||
} else if (rowElement.querySelector('[data-dtype="block"]')?.getAttribute("data-detached") === "true") {
|
||||
iconAriaLabel = window.siyuan.languages.rowTip.substring(0, window.siyuan.languages.rowTip.lastIndexOf("<br"));
|
||||
}
|
||||
html = `<button data-type="NodeAttributeViewRowMenu" data-node-id="${dataNodeId}" data-row-id="${rowElement.dataset.id}" class="ariaLabel" data-position="parentW" aria-label="${iconAriaLabel}"><svg><use xlink:href="#iconDrag"></use></svg><span ${protyle.disabled ? "" : 'draggable="true" class="fn__grab"'}></span></button>`;
|
||||
html = `<button data-type="NodeAttributeViewRowMenu" data-node-id="${dataNodeId}" data-row-id="${rowElement.dataset.id}" data-group-id="${bodyElement.dataset.groupId}" class="ariaLabel" data-position="parentW" aria-label="${iconAriaLabel}"><svg><use xlink:href="#iconDrag"></use></svg><span ${protyle.disabled ? "" : 'draggable="true" class="fn__grab"'}></span></button>`;
|
||||
if (!protyle.disabled) {
|
||||
html = `<button data-type="NodeAttributeViewRow" data-node-id="${dataNodeId}" data-row-id="${rowElement.dataset.id}" class="ariaLabel" data-position="parentW" aria-label="${isMac() ? window.siyuan.languages.addBelowAbove : window.siyuan.languages.addBelowAbove.replace("⌥", "Alt+")}"><svg><use xlink:href="#iconAdd"></use></svg></button>${html}`;
|
||||
html = `<button data-type="NodeAttributeViewRow" data-node-id="${dataNodeId}" data-row-id="${rowElement.dataset.id}" data-group-id="${bodyElement.dataset.groupId}" class="ariaLabel" data-position="parentW" aria-label="${isMac() ? window.siyuan.languages.addBelowAbove : window.siyuan.languages.addBelowAbove.replace("⌥", "Alt+")}"><svg><use xlink:href="#iconAdd"></use></svg></button>${html}`;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -224,7 +224,8 @@ export const initUI = (protyle: IProtyle) => {
|
|||
}
|
||||
Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${buttonElement.getAttribute("data-node-id")}"]`)).find(item => {
|
||||
if (!isInEmbedBlock(item) && protyle.gutter.isMatchNode(item)) {
|
||||
const rowItem = item.querySelector(`.av__row[data-id="${buttonElement.dataset.rowId}"]`);
|
||||
const bodyQueryClass = buttonElement.dataset.groupId ? `.av__body[data-group-id="${buttonElement.dataset.groupId}"] ` : "";
|
||||
const rowItem = item.querySelector(bodyQueryClass + `.av__row[data-id="${buttonElement.dataset.rowId}"]`);
|
||||
Array.from(protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--hl, .av__row--hl")).forEach(hlItem => {
|
||||
if (item !== hlItem) {
|
||||
hlItem.classList.remove("protyle-wysiwyg--hl");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue