From 5f24b2dc9854880efebd9b80f6f3aa59b3633264 Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Tue, 17 May 2022 09:47:19 -0700 Subject: [PATCH] Fix Create Parent dialog --- chrome/content/zotero/createParentDialog.js | 8 +++++++- ...teParentDialog.xul => createParentDialog.xhtml} | 14 +++++++------- chrome/content/zotero/zoteroPane.js | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) rename chrome/content/zotero/{createParentDialog.xul => createParentDialog.xhtml} (92%) diff --git a/chrome/content/zotero/createParentDialog.js b/chrome/content/zotero/createParentDialog.js index 2253f7da05..dad94f3edb 100644 --- a/chrome/content/zotero/createParentDialog.js +++ b/chrome/content/zotero/createParentDialog.js @@ -29,7 +29,7 @@ var io; let createParent; function toggleAccept(enabled) { - document.documentElement.getButton("accept").disabled = !enabled; + document.querySelector('dialog').getButton("accept").disabled = !enabled; } function doLoad() { @@ -45,6 +45,12 @@ function doLoad() { item: io.dataIn.item, toggleAccept }); + + document.addEventListener('dialogaccept', (event) => { + doAccept(); + event.preventDefault(); + }); + document.addEventListener('dialogextra2', doManualEntry); } function doUnload() { diff --git a/chrome/content/zotero/createParentDialog.xul b/chrome/content/zotero/createParentDialog.xhtml similarity index 92% rename from chrome/content/zotero/createParentDialog.xul rename to chrome/content/zotero/createParentDialog.xhtml index e40f83280d..5748a23a2b 100644 --- a/chrome/content/zotero/createParentDialog.xul +++ b/chrome/content/zotero/createParentDialog.xhtml @@ -9,20 +9,19 @@ %zoteroDTD; ]> +