From faf15c08aa6777d1ae2d112c55659e08d53156c6 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Fri, 14 Feb 2020 22:34:44 -0500 Subject: Rename optionsUpdate event to optionsUpdated Past tense better indicates that the options were changed, but no data is being included as part of the event. It is also more consistent with the other event names the yomichan object currently provides. --- ext/mixed/js/core.js | 6 +++--- ext/mixed/js/display.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'ext/mixed') diff --git a/ext/mixed/js/core.js b/ext/mixed/js/core.js index c273bb87..2dd9cf40 100644 --- a/ext/mixed/js/core.js +++ b/ext/mixed/js/core.js @@ -248,7 +248,7 @@ const yomichan = (() => { this._messageHandlers = new Map([ ['getUrl', this._onMessageGetUrl.bind(this)], - ['optionsUpdate', this._onMessageOptionsUpdate.bind(this)], + ['optionsUpdated', this._onMessageOptionsUpdated.bind(this)], ['zoomChanged', this._onMessageZoomChanged.bind(this)] ]); @@ -276,8 +276,8 @@ const yomichan = (() => { return {url: window.location.href}; } - _onMessageOptionsUpdate({source}) { - this.trigger('optionsUpdate', {source}); + _onMessageOptionsUpdated({source}) { + this.trigger('optionsUpdated', {source}); } _onMessageZoomChanged({oldZoomFactor, newZoomFactor}) { diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js index 90b7aaf3..045ce906 100644 --- a/ext/mixed/js/display.js +++ b/ext/mixed/js/display.js @@ -52,7 +52,7 @@ class Display { const displayGeneratorPromise = this.displayGenerator.prepare(); const updateOptionsPromise = this.updateOptions(options); await Promise.all([displayGeneratorPromise, updateOptionsPromise]); - yomichan.on('optionsUpdate', () => this.updateOptions(null)); + yomichan.on('optionsUpdated', () => this.updateOptions(null)); } onError(_error) { -- cgit v1.2.3