mirror of
https://github.com/zotero/zotero.git
synced 2026-10-05 02:43:38 +00:00
ensure tag selector is initialized before using (#5574)
If the tag selector is not initialized in setScope, initialize it before proceeding. This fixes the tag selector being stuck in loading state after expanding. Fixes: #5573
This commit is contained in:
parent
18a34b938f
commit
90972577af
1 changed files with 8 additions and 7 deletions
|
|
@ -1716,12 +1716,11 @@ var ZoteroPane = new function () {
|
|||
};
|
||||
|
||||
|
||||
this.handleTagSelectorResize = Zotero.Utilities.debounce(function () {
|
||||
this.handleTagSelectorResize = Zotero.Utilities.debounce(async function () {
|
||||
if (this.tagSelectorShown()) {
|
||||
// Initialize if dragging open after startup
|
||||
if (!this.tagSelector) {
|
||||
this.initTagSelector();
|
||||
this.setTagScope();
|
||||
await this.setTagScope();
|
||||
}
|
||||
this.tagSelector.handleResize();
|
||||
}
|
||||
|
|
@ -1742,7 +1741,7 @@ var ZoteroPane = new function () {
|
|||
|
||||
|
||||
// Keep in sync with ZoteroStandalone.updateViewOption()
|
||||
this.toggleTagSelector = function () {
|
||||
this.toggleTagSelector = async function () {
|
||||
var container = document.getElementById('zotero-tag-selector-container');
|
||||
var showing = container.getAttribute('collapsed') == 'true';
|
||||
container.setAttribute('collapsed', !showing);
|
||||
|
|
@ -1750,9 +1749,8 @@ var ZoteroPane = new function () {
|
|||
// If showing, set scope to items in current view
|
||||
// and focus filter textbox
|
||||
if (showing) {
|
||||
this.initTagSelector();
|
||||
await this.setTagScope();
|
||||
ZoteroPane.tagSelector.focusTextbox();
|
||||
this.setTagScope();
|
||||
}
|
||||
// If hiding, clear selection
|
||||
else {
|
||||
|
|
@ -1776,9 +1774,12 @@ var ZoteroPane = new function () {
|
|||
*
|
||||
* Passed to the items tree to trigger on changes
|
||||
*/
|
||||
this.setTagScope = function () {
|
||||
this.setTagScope = async function () {
|
||||
var collectionTreeRow = self.getCollectionTreeRow();
|
||||
if (self.tagSelectorShown()) {
|
||||
if (!ZoteroPane.tagSelector) {
|
||||
await this.initTagSelector();
|
||||
}
|
||||
if (collectionTreeRow.editable) {
|
||||
ZoteroPane_Local.tagSelector.setMode('edit');
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue