From 36d9a79f7be85406489491670bda5284fa897d02 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 5 May 2021 10:09:32 +0200 Subject: Fix player settings dispose --- .../player/videojs-components/settings-menu-button.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'client/src/assets/player') diff --git a/client/src/assets/player/videojs-components/settings-menu-button.ts b/client/src/assets/player/videojs-components/settings-menu-button.ts index e67a3da06..74788a897 100644 --- a/client/src/assets/player/videojs-components/settings-menu-button.ts +++ b/client/src/assets/player/videojs-components/settings-menu-button.ts @@ -95,11 +95,6 @@ class SettingsButton extends Button { } } - document.removeEventListener('click', this.documentClickHandler) - if (this.isInIframe()) { - window.removeEventListener('blur', this.documentClickHandler) - } - this.hideDialog() if (this.settingsButtonOptions.entries.length === 0) { @@ -107,6 +102,14 @@ class SettingsButton extends Button { } } + dispose () { + document.removeEventListener('click', this.documentClickHandler) + + if (this.isInIframe()) { + window.removeEventListener('blur', this.documentClickHandler) + } + } + onAddSettingsItem (event: any, data: any) { const [ entry, options ] = data -- cgit v1.2.3