Fix note type picker appearing for Google Docs

Report https://forums.zotero.org/discussion/126026/endnotes-option-showing-in-google-docs
This commit is contained in:
Adomas Venčkauskas 2025-08-25 12:12:07 +03:00
parent 4d803fe2cd
commit b1dbe35102

View file

@ -276,15 +276,24 @@
}
});
}
handleStyleChanged(style) {
this.querySelector('#locale-selector').style = style;
toggleNoteTypePicker(style) {
const styleData = style ? Zotero.Styles.get(style) : null;
const isNoteStyle = (styleData || {}).class === 'note';
const noMultipleNotes = this.hasAttribute('no-multi-notes');
this.querySelector('.display-as-wrapper').style.display
= (isNoteStyle && !noMultipleNotes) ? '' : 'none';
}
toggleAttribute(name, force) {
super.toggleAttribute(name, force);
this.toggleNoteTypePicker(this.querySelector('#locale-selector').style);
}
handleStyleChanged(style) {
this.querySelector('#locale-selector').style = style;
this.toggleNoteTypePicker(style);
}
}
customElements.define('locale-selector', LocaleSelector);