closes #1098, Edit Citation not working in new document
This commit is contained in:
parent
31c130a460
commit
f990e76353
|
@ -258,7 +258,7 @@ var Zotero_Citation_Dialog = new function () {
|
||||||
* Sorts the list of citations
|
* Sorts the list of citations
|
||||||
*/
|
*/
|
||||||
function sortCitation() {
|
function sortCitation() {
|
||||||
io.citation.properties.sort = _sortCheckbox.checked;
|
io.citation.properties.sort = _sortCheckbox && _sortCheckbox.checked;
|
||||||
if(_sortCheckbox.checked) {
|
if(_sortCheckbox.checked) {
|
||||||
_getCitation();
|
_getCitation();
|
||||||
|
|
||||||
|
|
|
@ -1088,6 +1088,16 @@ Zotero.Integration.Session.prototype.editCitation = function(index, citation) {
|
||||||
var me = this;
|
var me = this;
|
||||||
var io = new function() { this.wrappedJSObject = 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
|
// create object to hold citation
|
||||||
io.citation = (citation ? citation.clone() : this.style.createCitation());
|
io.citation = (citation ? citation.clone() : this.style.createCitation());
|
||||||
io.citation.properties.index = parseInt(index, 10);
|
io.citation.properties.index = parseInt(index, 10);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user