From 17d07b37bca0e15b478fe9b054f89bdc4e4a4a3d Mon Sep 17 00:00:00 2001 From: Sean Takats Date: Sat, 28 Feb 2009 23:11:10 +0000 Subject: [PATCH] Checking in Frank Bennett's single-to-multiple citation dialog fix. --- chrome/content/zotero/addCitationDialog.js | 24 ++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/addCitationDialog.js b/chrome/content/zotero/addCitationDialog.js index d54c9d72b..fe1e7ceb3 100644 --- a/chrome/content/zotero/addCitationDialog.js +++ b/chrome/content/zotero/addCitationDialog.js @@ -149,14 +149,34 @@ var Zotero_Citation_Dialog = new function () { function toggleMultipleSources() { _multipleSourcesOn = !_multipleSourcesOn; if(_multipleSourcesOn) { + var items = itemsView.getSelectedItems(true); + var itemID = (items.length ? items[0] : false); + // var itemDataID = itemID+"::"+0; document.getElementById("multiple-sources").hidden = undefined; document.getElementById("zotero-add-citation-dialog").width = "750"; document.getElementById("multiple-sources-button").label = Zotero.getString("citation.singleSource"); + // move user field content to multiple before adding XXXXX + if (itemID) { + // _itemData[itemDataID] = new Object(); + _itemData[itemID] = new Object(); + for (box in _preserveData) { + element = document.getElementById(box); + // _itemData[itemDataID][box] = element[_preserveData[box]]; + _itemData[itemID][box] = element[_preserveData[box]]; + } + } window.sizeToContent(); window.moveTo((window.screenX-75), window.screenY); treeItemSelected(); // disable adding info until citation added _itemSelected(false); + // add current selection + if (itemID) { + this.add(); + } else { + _updateAccept(); + _updatePreview(); + } } else { document.getElementById("multiple-sources").hidden = true; document.getElementById("zotero-add-citation-dialog").width = "600"; @@ -174,9 +194,9 @@ var Zotero_Citation_Dialog = new function () { // delete all items _clearCitationList(); + _updateAccept(); + _updatePreview(); } - _updateAccept(); - _updatePreview(); } /*