diff --git a/lib/Recommend.js b/lib/Recommend.js index 7db4136..9d750ec 100644 --- a/lib/Recommend.js +++ b/lib/Recommend.js @@ -19,7 +19,7 @@ class Recommender { constructor() { this.telemetryLog = new TelemetryLog(); const methodsToBind = ['endOnboard', 'showPanel', 'waitForWindow', - 'handlePanelHide', 'hidePanel']; + 'handlePanelHide', 'handlePanelShow', 'hidePanel']; for (let key of methodsToBind) { // eslint-disable-line prefer-const this[key] = this[key].bind(this); } @@ -72,18 +72,22 @@ class Recommender { height: panelRecHeight + footerHeight, contentURL: './recommendation/recWindow.html', contentScriptFile: './recommendation/notify.js', + onShow: this.handlePanelShow, onHide: this.handlePanelHide, }); } showPanel(button) { - this.telemetryLog.showPanel(this.activeRecDomain); button.handlePanelOpen(); this.panel.show({ position: button, }); } + handlePanelShow() { + this.telemetryLog.showPanel(this.activeRecDomain); + } + handlePanelHide() { this.telemetryLog.hidePanel(this.activeRecDomain); const win = tabs.activeTab.window;