fix: add annotation to note bug
This commit is contained in:
parent
b38c1ceeaa
commit
2f31c7db06
|
|
@ -681,7 +681,10 @@ class AddonEvents extends AddonBase {
|
|||
const noteEditor = _window.document.getElementById("zotero-note-editor");
|
||||
|
||||
t = 0;
|
||||
while (!noteEditor.getCurrentInstance() && t < 500) {
|
||||
while (
|
||||
(!noteEditor.getCurrentInstance || !noteEditor.getCurrentInstance()) &&
|
||||
t < 500
|
||||
) {
|
||||
t += 1;
|
||||
await Zotero.Promise.delay(10);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -298,6 +298,7 @@ class AddonViews extends AddonBase {
|
|||
}
|
||||
moreButton.setAttribute("knowledgeinit", "true");
|
||||
const addAnnotationNoteButton = _document.createElement("div");
|
||||
addAnnotationNoteButton.setAttribute("style", "margin: 5px;");
|
||||
addAnnotationNoteButton.innerHTML = this.editorIcon["addAnnotationNote"];
|
||||
|
||||
let annotationWrapper = moreButton;
|
||||
|
|
@ -367,10 +368,13 @@ class AddonViews extends AddonBase {
|
|||
e.preventDefault();
|
||||
});
|
||||
addAnnotationNoteButton.addEventListener("mouseover", (e: XULEvent) => {
|
||||
e.target.setAttribute("style", "background: #F0F0F0;");
|
||||
addAnnotationNoteButton.setAttribute(
|
||||
"style",
|
||||
"background: #F0F0F0; margin: 5px;"
|
||||
);
|
||||
});
|
||||
addAnnotationNoteButton.addEventListener("mouseout", (e: XULEvent) => {
|
||||
e.target.removeAttribute("style");
|
||||
addAnnotationNoteButton.setAttribute("style", "margin: 5px;");
|
||||
});
|
||||
moreButton.before(addAnnotationNoteButton);
|
||||
updateCount += 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue