From 300af4477f823285c6a2b294e6ccbe30dcde1e1b Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Tue, 24 May 2022 12:02:37 -0600 Subject: [PATCH] fx-compat: Fix Attach Link dialog --- chrome/content/zotero/attachLink.js | 8 ++++++++ .../{attachLink.xul => attachLink.xhtml} | 19 ++++++++++--------- chrome/content/zotero/zoteroPane.js | 2 +- 3 files changed, 19 insertions(+), 10 deletions(-) rename chrome/content/zotero/{attachLink.xul => attachLink.xhtml} (72%) diff --git a/chrome/content/zotero/attachLink.js b/chrome/content/zotero/attachLink.js index c6fe5a3e56..e48dba14fd 100644 --- a/chrome/content/zotero/attachLink.js +++ b/chrome/content/zotero/attachLink.js @@ -24,6 +24,14 @@ */ var Zotero_AttachLink = new function() { + this.load = function () { + document.addEventListener('dialogaccept', (event) => { + if (!this.submit()) { + event.preventDefault(); + } + }); + }; + function getAttachFileLabel() { return window.opener.document .getElementById('zotero-tb-attachment-add-file-link') diff --git a/chrome/content/zotero/attachLink.xul b/chrome/content/zotero/attachLink.xhtml similarity index 72% rename from chrome/content/zotero/attachLink.xul rename to chrome/content/zotero/attachLink.xhtml index 4e39dc7c39..3a5b7877ec 100644 --- a/chrome/content/zotero/attachLink.xul +++ b/chrome/content/zotero/attachLink.xhtml @@ -4,14 +4,14 @@ - + onload="Zotero_AttachLink.load()"> +