convert fullscreen children listeners logic to ~ES6

remove gulp serve shortcut
This commit is contained in:
Som Meaden 2020-04-04 20:00:43 +10:00
parent 11214caf77
commit 12ab1ed144
2 changed files with 5 additions and 6 deletions

View File

@ -31,7 +31,6 @@
"browserslist": "> 1%", "browserslist": "> 1%",
"scripts": { "scripts": {
"build": "gulp build", "build": "gulp build",
"serve": "gulp serve",
"lint": "eslint src/js && npm run-script remark", "lint": "eslint src/js && npm run-script remark",
"lint:fix": "eslint --fix src/js", "lint:fix": "eslint --fix src/js",
"remark": "remark -f --use 'validate-links=repository:\"sampotts/plyr\"' '{,!(node_modules),.?**/}*.md'", "remark": "remark -f --use 'validate-links=repository:\"sampotts/plyr\"' '{,!(node_modules),.?**/}*.md'",

View File

@ -816,13 +816,13 @@ class Listeners {
// Also update controls.hover state for any non-player children of fullscreen element (as above) // Also update controls.hover state for any non-player children of fullscreen element (as above)
if (elements.fullscreen) { if (elements.fullscreen) {
for (let i = 0; i < elements.fullscreen.children.length; i++) { Array.from(elements.fullscreen.children)
if (!elements.fullscreen.children[i].contains(elements.container)) { .filter(c => !c.contains(elements.container))
this.bind(elements.fullscreen.children[i], 'mouseenter mouseleave', event => { .forEach(child => {
this.bind(child, 'mouseenter mouseleave', event => {
elements.controls.hover = !player.touch && event.type === 'mouseenter'; elements.controls.hover = !player.touch && event.type === 'mouseenter';
}); });
} });
}
} }
// Update controls.pressed state (used for ui.toggleControls to avoid hiding when interacting) // Update controls.pressed state (used for ui.toggleControls to avoid hiding when interacting)