diff --git a/chrome/content/zotero/integration/addCitationDialog.js b/chrome/content/zotero/integration/addCitationDialog.js index 3b45a3656..34b5e0bfc 100644 --- a/chrome/content/zotero/integration/addCitationDialog.js +++ b/chrome/content/zotero/integration/addCitationDialog.js @@ -34,6 +34,7 @@ var Zotero_Citation_Dialog = new function () { "suppress-author":["checked", false] }; + var _accepted = false; var _itemData = new Object(); var _multipleSourcesOn = false; var _lastSelected = null; @@ -581,6 +582,8 @@ var Zotero_Citation_Dialog = new function () { * called when accept button is clicked */ function accept() { + if(_accepted) return true; + _getCitation(); var isCustom = _previewShown && io.citation.citationItems.length // if a citation is selected && _originalHTML @@ -600,6 +603,7 @@ var Zotero_Citation_Dialog = new function () { } io.accept(); + _accepted = true; return true; } @@ -607,8 +611,12 @@ var Zotero_Citation_Dialog = new function () { * called when cancel button is clicked */ function cancel() { + if(_accepted) return true; io.citation.citationItems = new Array(); + io.accept(); + _accepted = true; + return true; } /* diff --git a/chrome/content/zotero/integration/addCitationDialog.xul b/chrome/content/zotero/integration/addCitationDialog.xul index 6300f0fab..1888eec78 100644 --- a/chrome/content/zotero/integration/addCitationDialog.xul +++ b/chrome/content/zotero/integration/addCitationDialog.xul @@ -41,7 +41,7 @@ onunload="doUnload();" ondialogaccept="return Zotero_Citation_Dialog.accept();" ondialogcancel="Zotero_Citation_Dialog.cancel();" - onclose="Zotero_Citation_Dialog.cancel(); event.preventDefault(); event.stopPropagation();" + onclose="Zotero_Citation_Dialog.cancel();" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" persist="screenX screenY width height" resizable="true" diff --git a/chrome/content/zotero/integration/editBibliographyDialog.js b/chrome/content/zotero/integration/editBibliographyDialog.js index ee32a3f39..f9663dde2 100644 --- a/chrome/content/zotero/integration/editBibliographyDialog.js +++ b/chrome/content/zotero/integration/editBibliographyDialog.js @@ -235,15 +235,18 @@ var Zotero_Bibliography_Dialog = new function () { * Called when OK button is pressed */ this.accept = function() { - _accepted = true; + if(_accepted) return; _updatePreview(true); + _accepted = true; } /** * Called when Cancel button is pressed */ this.close = function() { - if(!_accepted) bibEditInterface.cancel(); + if(_accepted) return; + bibEditInterface.cancel(); + _accepted = true; } /** diff --git a/chrome/content/zotero/integration/editBibliographyDialog.xul b/chrome/content/zotero/integration/editBibliographyDialog.xul index faee0822f..5b56b6c29 100644 --- a/chrome/content/zotero/integration/editBibliographyDialog.xul +++ b/chrome/content/zotero/integration/editBibliographyDialog.xul @@ -38,7 +38,7 @@ onload="Zotero_Bibliography_Dialog.load();" ondialogaccept="Zotero_Bibliography_Dialog.accept();" ondialogcancel="Zotero_Bibliography_Dialog.close();" - onclose="Zotero_Bibliography_Dialog.close(); event.preventDefault(); event.stopPropagation();" + onclose="Zotero_Bibliography_Dialog.close();" onunload="doUnload();" buttons="extra1,extra2,accept,cancel" buttonpack="end" xmlns:html="http://www.w3.org/1999/xhtml"