fix: workspace template menu bug
This commit is contained in:
parent
2015800465
commit
9a1200b585
|
|
@ -3,7 +3,7 @@
|
|||
"addonName": "Zotero Better Notes",
|
||||
"addonID": "Knowledge4Zotero@windingwind.com",
|
||||
"addonRef": "Knowledge4Zotero",
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.1",
|
||||
"description": "Everything about note management. All in Zotero.",
|
||||
"main": "src/index.js",
|
||||
"scripts": {
|
||||
|
|
|
|||
18
src/views.ts
18
src/views.ts
|
|
@ -648,13 +648,17 @@ class AddonViews extends AddonBase {
|
|||
const menuitem = _window.document.createElement("menuitem");
|
||||
menuitem.setAttribute("id", template.name);
|
||||
menuitem.setAttribute("label", template.name);
|
||||
menuitem.addEventListener("click", (e) => {
|
||||
this._Addon.events.onEditorEvent(
|
||||
new EditorMessage(`insert${type}UsingTemplate`, {
|
||||
params: { templateName: template.name },
|
||||
})
|
||||
);
|
||||
});
|
||||
menuitem.setAttribute(
|
||||
"oncommand",
|
||||
`
|
||||
Zotero.Knowledge4Zotero.events.onEditorEvent({
|
||||
type: "insert${type}UsingTemplate",
|
||||
content: {
|
||||
params: { templateName: "${template.name}" },
|
||||
},
|
||||
});`
|
||||
);
|
||||
|
||||
if (template.disabled) {
|
||||
menuitem.setAttribute("disabled", true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<rdf:Seq>
|
||||
<rdf:li>
|
||||
<rdf:Description>
|
||||
<em:version>0.3.0</em:version>
|
||||
<em:version>0.3.1</em:version>
|
||||
<em:targetApplication>
|
||||
<rdf:Description>
|
||||
<em:id>zotero@chnm.gmu.edu</em:id>
|
||||
|
|
|
|||
Loading…
Reference in New Issue