Explorar o código

return document.documentElement if the anhored element is not found

Gildas %!s(int64=5) %!d(string=hai) anos
pai
achega
60ab14ec6a
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      extension/ui/content/content-ui-editor-web.js

+ 2 - 1
extension/ui/content/content-ui-editor-web.js

@@ -1802,7 +1802,8 @@ table {
 	}
 
 	function getAnchorElement(containerElement) {
-		return document.querySelector("[data-single-file-note-refs^=" + JSON.stringify(containerElement.dataset.noteId) + "], [data-single-file-note-refs$=" + JSON.stringify(containerElement.dataset.noteId) + "], [data-single-file-note-refs*=" + JSON.stringify("," + containerElement.dataset.noteId + ",") + "]");
+		return document.querySelector("[data-single-file-note-refs^=" + JSON.stringify(containerElement.dataset.noteId) + "], [data-single-file-note-refs$=" + JSON.stringify(containerElement.dataset.noteId) + "], [data-single-file-note-refs*=" + JSON.stringify("," + containerElement.dataset.noteId + ",") + "]")
+			|| document.documentElement;
 	}
 
 	function addNoteRef(anchorElement, noteId) {