Add Filename option for PDF tab title pref

This commit is contained in:
Martynas Bagdonas 2023-02-06 19:44:01 +00:00
parent 382bde0fc2
commit a78860f092

View file

@ -172,14 +172,15 @@ class ReaderInstance {
}
async updateTitle() {
let type = Zotero.Prefs.get('tabs.title.reader');
let item = Zotero.Items.get(this._itemID);
let readerTitle = item.getDisplayTitle();
let parentItem = item.parentItem;
if (parentItem) {
// If type is "filename", then readerTitle already has it
if (parentItem && type !== 'filename') {
let attachment = await parentItem.getBestAttachment();
if (attachment && attachment.id === this._itemID) {
let parts = [];
let type = Zotero.Prefs.get('tabs.title.reader');
let creator = parentItem.getField('firstCreator');
let year = parentItem.getField('year');
let title = parentItem.getDisplayTitle();