closes #1098, Edit Citation not working in new document
This commit is contained in:
parent
f99d96694d
commit
501d6c6e77
2 changed files with 11 additions and 1 deletions
|
@ -258,7 +258,7 @@ var Zotero_Citation_Dialog = new function () {
|
|||
* Sorts the list of citations
|
||||
*/
|
||||
function sortCitation() {
|
||||
io.citation.properties.sort = _sortCheckbox.checked;
|
||||
io.citation.properties.sort = _sortCheckbox && _sortCheckbox.checked;
|
||||
if(_sortCheckbox.checked) {
|
||||
_getCitation();
|
||||
|
||||
|
|
|
@ -1088,6 +1088,16 @@ Zotero.Integration.Session.prototype.editCitation = function(index, citation) {
|
|||
var me = this;
|
||||
var io = new function() { this.wrappedJSObject = this; }
|
||||
|
||||
// if there's already a citation, make sure we have item IDs in addition to keys
|
||||
if(citation) {
|
||||
for each(var citationItem in citation.citationItems) {
|
||||
if(citationItem.key && !citationItem.itemID) {
|
||||
var item = Zotero.Items.getByKey([citationItem.key]);
|
||||
if(item) citationItem.itemID = item.itemID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// create object to hold citation
|
||||
io.citation = (citation ? citation.clone() : this.style.createCitation());
|
||||
io.citation.properties.index = parseInt(index, 10);
|
||||
|
|
Loading…
Reference in a new issue