diff options
Diffstat (limited to 'client/src/assets/player/settings-menu-item.ts')
-rw-r--r-- | client/src/assets/player/settings-menu-item.ts | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/client/src/assets/player/settings-menu-item.ts b/client/src/assets/player/settings-menu-item.ts index 665ce6fc2..698f4627a 100644 --- a/client/src/assets/player/settings-menu-item.ts +++ b/client/src/assets/player/settings-menu-item.ts | |||
@@ -1,7 +1,10 @@ | |||
1 | // Author: Yanko Shterev | 1 | // Author: Yanko Shterev |
2 | // Thanks https://github.com/yshterev/videojs-settings-menu | 2 | // Thanks https://github.com/yshterev/videojs-settings-menu |
3 | 3 | ||
4 | // FIXME: something weird with our path definition in tsconfig and typings | ||
5 | // @ts-ignore | ||
4 | import * as videojs from 'video.js' | 6 | import * as videojs from 'video.js' |
7 | |||
5 | import { toTitleCase } from './utils' | 8 | import { toTitleCase } from './utils' |
6 | import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings' | 9 | import { VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings' |
7 | 10 | ||
@@ -10,7 +13,7 @@ const component: VideoJSComponentInterface = videojsUntyped.getComponent('Compon | |||
10 | 13 | ||
11 | class SettingsMenuItem extends MenuItem { | 14 | class SettingsMenuItem extends MenuItem { |
12 | 15 | ||
13 | constructor (player: videojs.Player, options, entry: string, menuButton: VideoJSComponentInterface) { | 16 | constructor (player: videojs.Player, options: any, entry: string, menuButton: VideoJSComponentInterface) { |
14 | super(player, options) | 17 | super(player, options) |
15 | 18 | ||
16 | this.settingsButton = menuButton | 19 | this.settingsButton = menuButton |
@@ -55,7 +58,7 @@ class SettingsMenuItem extends MenuItem { | |||
55 | this.transitionEndHandler = this.onTransitionEnd.bind(this) | 58 | this.transitionEndHandler = this.onTransitionEnd.bind(this) |
56 | } | 59 | } |
57 | 60 | ||
58 | onSubmenuClick (event) { | 61 | onSubmenuClick (event: any) { |
59 | let target = null | 62 | let target = null |
60 | 63 | ||
61 | if (event.type === 'tap') { | 64 | if (event.type === 'tap') { |
@@ -150,7 +153,7 @@ class SettingsMenuItem extends MenuItem { | |||
150 | * | 153 | * |
151 | * @method PrefixedEvent | 154 | * @method PrefixedEvent |
152 | */ | 155 | */ |
153 | PrefixedEvent (element, type, callback, action = 'addEvent') { | 156 | PrefixedEvent (element: any, type: any, callback: any, action = 'addEvent') { |
154 | let prefix = ['webkit', 'moz', 'MS', 'o', ''] | 157 | let prefix = ['webkit', 'moz', 'MS', 'o', ''] |
155 | 158 | ||
156 | for (let p = 0; p < prefix.length; p++) { | 159 | for (let p = 0; p < prefix.length; p++) { |
@@ -166,7 +169,7 @@ class SettingsMenuItem extends MenuItem { | |||
166 | } | 169 | } |
167 | } | 170 | } |
168 | 171 | ||
169 | onTransitionEnd (event) { | 172 | onTransitionEnd (event: any) { |
170 | if (event.propertyName !== 'margin-right') { | 173 | if (event.propertyName !== 'margin-right') { |
171 | return | 174 | return |
172 | } | 175 | } |
@@ -229,8 +232,8 @@ class SettingsMenuItem extends MenuItem { | |||
229 | ) | 232 | ) |
230 | } | 233 | } |
231 | 234 | ||
232 | update (event?: Event) { | 235 | update (event?: any) { |
233 | let target = null | 236 | let target: HTMLElement = null |
234 | let subMenu = this.subMenu.name() | 237 | let subMenu = this.subMenu.name() |
235 | 238 | ||
236 | if (event && event.type === 'tap') { | 239 | if (event && event.type === 'tap') { |