mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 00:50:13 +01:00
Replace the deprecated isSameNode method in DOM Level 4 with the === operator (#15347)
This commit is contained in:
parent
a730a575d5
commit
c88f99646c
51 changed files with 160 additions and 160 deletions
|
|
@ -85,7 +85,7 @@ export const avRender = (element: Element, protyle: IProtyle, cb?: (data: IAV) =
|
|||
const created = protyle.options.history?.created;
|
||||
const snapshot = protyle.options.history?.snapshot;
|
||||
let searchInputElement = e.querySelector('[data-type="av-search"]') as HTMLInputElement;
|
||||
const isSearching = searchInputElement && document.activeElement.isSameNode(searchInputElement);
|
||||
const isSearching = searchInputElement && (document.activeElement === searchInputElement);
|
||||
const query = searchInputElement?.value || "";
|
||||
fetchPost(created ? "/api/av/renderHistoryAttributeView" : (snapshot ? "/api/av/renderSnapshotAttributeView" : "/api/av/renderAttributeView"), {
|
||||
id: e.getAttribute("data-av-id"),
|
||||
|
|
@ -336,7 +336,7 @@ ${cell.color ? `color:${cell.color};` : ""}">${renderCell(cell.value, rowIndex,
|
|||
} else if (!avPanelElement && !isSearching && getSelection().rangeCount > 0) {
|
||||
const range = getSelection().getRangeAt(0);
|
||||
const blockElement = hasClosestBlock(range.startContainer);
|
||||
if (blockElement && e.isSameNode(blockElement)) {
|
||||
if (blockElement && (e === blockElement)) {
|
||||
focusBlock(e);
|
||||
}
|
||||
} else if (avPanelElement && !newCellElement) {
|
||||
|
|
@ -366,7 +366,7 @@ ${cell.color ? `color:${cell.color};` : ""}">${renderCell(cell.value, rowIndex,
|
|||
const range = getSelection().getRangeAt(0);
|
||||
if (!hasClosestByClassName(range.startContainer, "av__title")) {
|
||||
const blockElement = hasClosestBlock(range.startContainer);
|
||||
if (blockElement && e.isSameNode(blockElement) && !isSearching) {
|
||||
if (blockElement && (e === blockElement) && !isSearching) {
|
||||
focusBlock(e);
|
||||
}
|
||||
}
|
||||
|
|
@ -398,7 +398,7 @@ ${cell.color ? `color:${cell.color};` : ""}">${renderCell(cell.value, rowIndex,
|
|||
if (event.isComposing) {
|
||||
return;
|
||||
}
|
||||
if (searchInputElement.value || document.activeElement.isSameNode(searchInputElement)) {
|
||||
if (searchInputElement.value || (document.activeElement === searchInputElement)) {
|
||||
viewsElement.classList.add("av__views--show");
|
||||
} else {
|
||||
viewsElement.classList.remove("av__views--show");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue