Fix an issue with reordering dictionary settings (#1812)
This commit is contained in:
parent
24ec22b2e1
commit
daa44a8389
@ -33,6 +33,7 @@ class CollapsibleDictionaryController {
|
|||||||
|
|
||||||
yomichan.on('databaseUpdated', this._onDatabaseUpdated.bind(this));
|
yomichan.on('databaseUpdated', this._onDatabaseUpdated.bind(this));
|
||||||
this._settingsController.on('optionsChanged', this._onOptionsChanged.bind(this));
|
this._settingsController.on('optionsChanged', this._onOptionsChanged.bind(this));
|
||||||
|
this._settingsController.on('dictionarySettingsReordered', this._onDictionarySettingsReordered.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Private
|
// Private
|
||||||
@ -88,6 +89,11 @@ class CollapsibleDictionaryController {
|
|||||||
this._setDefinitionsCollapsibleAll(value);
|
this._setDefinitionsCollapsibleAll(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async _onDictionarySettingsReordered() {
|
||||||
|
const options = await this._settingsController.getOptions();
|
||||||
|
this._onOptionsChanged({options});
|
||||||
|
}
|
||||||
|
|
||||||
_setupAllSelect(fragment, options) {
|
_setupAllSelect(fragment, options) {
|
||||||
const select = this._addSelect(fragment, 'All', '');
|
const select = this._addSelect(fragment, 'All', '');
|
||||||
|
|
||||||
|
@ -325,6 +325,8 @@ class DictionaryController {
|
|||||||
value: dictionaries
|
value: dictionaries
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
|
this._settingsController.trigger('dictionarySettingsReordered', {source: this});
|
||||||
|
|
||||||
await this._updateEntries();
|
await this._updateEntries();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,6 +31,7 @@ class SecondarySearchDictionaryController {
|
|||||||
|
|
||||||
yomichan.on('databaseUpdated', this._onDatabaseUpdated.bind(this));
|
yomichan.on('databaseUpdated', this._onDatabaseUpdated.bind(this));
|
||||||
this._settingsController.on('optionsChanged', this._onOptionsChanged.bind(this));
|
this._settingsController.on('optionsChanged', this._onOptionsChanged.bind(this));
|
||||||
|
this._settingsController.on('dictionarySettingsReordered', this._onDictionarySettingsReordered.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Private
|
// Private
|
||||||
@ -84,4 +85,9 @@ class SecondarySearchDictionaryController {
|
|||||||
const {detail: {value}} = e;
|
const {detail: {value}} = e;
|
||||||
node.dataset.enabled = `${value}`;
|
node.dataset.enabled = `${value}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async _onDictionarySettingsReordered() {
|
||||||
|
const options = await this._settingsController.getOptions();
|
||||||
|
this._onOptionsChanged({options});
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user