From 394aa8ddedd007885744d93a082b832093b1f4ab Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 11 Mar 2016 04:50:55 -0500 Subject: [PATCH] Update display title after item edit --- chrome/content/zotero/xpcom/data/item.js | 205 +++++++++++----------- chrome/content/zotero/xpcom/data/items.js | 3 +- test/tests/itemTreeViewTest.js | 11 ++ test/tests/translateTest.js | 14 +- 4 files changed, 121 insertions(+), 112 deletions(-) diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index c0bd83fcb..8fb769dbf 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -849,6 +849,105 @@ Zotero.Item.prototype.getDisplayTitle = function (includeAuthorAndDate) { } +/** + * Update the generated display title from the loaded data + */ +Zotero.Item.prototype.updateDisplayTitle = function () { + var title = this.getField('title', false, true); + var itemTypeID = this.itemTypeID; + var itemTypeName = Zotero.ItemTypes.getName(itemTypeID); + + if (title === "" && (itemTypeID == 8 || itemTypeID == 10)) { // 'letter' and 'interview' itemTypeIDs + var creatorsData = this.getCreators(); + var authors = []; + var participants = []; + for (let i=0; i 0) { + let names = []; + let max = Math.min(4, participants.length); + for (let i=0; i 0) { - let names = []; - let max = Math.min(4, participants.length); - for (let i=0; i