Convert additional for..in loops to for loops in getDisplayTitle()

This commit is contained in:
Dan Stillman 2014-09-19 20:39:23 -04:00
parent 10ba5e31d6
commit f09871a1ee

View file

@ -877,11 +877,12 @@ Zotero.Item.prototype.getDisplayTitle = function (includeAuthorAndDate) {
var itemTypeName = Zotero.ItemTypes.getName(itemTypeID);
if (!title && (itemTypeID == 8 || itemTypeID == 10)) { // 'letter' and 'interview' itemTypeIDs
var creators = this.getCreators();
var authors = [];
var participants = [];
let creators = this.getCreators();
let authors = [];
let participants = [];
if (creators) {
for each(var creator in creators) {
for (let i=0; i<creators.length; i++) {
let creator = creators[i];
if ((itemTypeID == 8 && creator.creatorTypeID == 16) || // 'letter'/'recipient'
(itemTypeID == 10 && creator.creatorTypeID == 7)) { // 'interview'/'interviewer'
participants.push(creator);
@ -896,9 +897,9 @@ Zotero.Item.prototype.getDisplayTitle = function (includeAuthorAndDate) {
var strParts = [];
if (includeAuthorAndDate) {
var names = [];
for each(author in authors) {
names.push(author.ref.lastName);
let names = [];
for (let i=0; i<authors.length; i++) {
names.push(authors[i].ref.lastName);
}
// TODO: Use same logic as getFirstCreatorSQL() (including "et al.")