aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/controls.js
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2020-01-13 16:31:17 +0000
committerGitHub <noreply@github.com>2020-01-13 16:31:17 +0000
commitb2d3ef5f380302f5a9b9cdfb6279a11e632bd2fa (patch)
tree92b50d757ae91d906c691015a8e1f7f3103aeb3a /src/js/controls.js
parent3424d08d3ac0587fffabe31cbf84b011ea9577b2 (diff)
parentb36b92b2478b5aac165be0d3d84cd1f011d4c8df (diff)
downloadplyr-b2d3ef5f380302f5a9b9cdfb6279a11e632bd2fa.tar.lz
plyr-b2d3ef5f380302f5a9b9cdfb6279a11e632bd2fa.tar.xz
plyr-b2d3ef5f380302f5a9b9cdfb6279a11e632bd2fa.zip
Merge pull request #1505 from nskazki/detach-event-listeners-on-destroy
Detach event listeners on destroy
Diffstat (limited to 'src/js/controls.js')
-rw-r--r--src/js/controls.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/js/controls.js b/src/js/controls.js
index aa5d7fba..a0bbc991 100644
--- a/src/js/controls.js
+++ b/src/js/controls.js
@@ -399,7 +399,8 @@ const controls = {
// https://bugzilla.mozilla.org/show_bug.cgi?id=1220143
bindMenuItemShortcuts(menuItem, type) {
// Navigate through menus via arrow keys and space
- on(
+ on.call(
+ this,
menuItem,
'keydown keyup',
event => {
@@ -449,7 +450,7 @@ const controls = {
// Enter will fire a `click` event but we still need to manage focus
// So we bind to keyup which fires after and set focus here
- on(menuItem, 'keyup', event => {
+ on.call(this, menuItem, 'keyup', event => {
if (event.which !== 13) {
return;
}
@@ -1460,7 +1461,7 @@ const controls = {
bindMenuItemShortcuts.call(this, menuItem, type);
// Show menu on click
- on(menuItem, 'click', () => {
+ on.call(this, menuItem, 'click', () => {
showMenuPanel.call(this, type, false);
});
@@ -1512,7 +1513,8 @@ const controls = {
);
// Go back via keyboard
- on(
+ on.call(
+ this,
pane,
'keydown',
event => {
@@ -1532,7 +1534,7 @@ const controls = {
);
// Go back via button click
- on(backButton, 'click', () => {
+ on.call(this, backButton, 'click', () => {
showMenuPanel.call(this, 'home', false);
});