aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlbin Larsson <mail@albinlarsson.com>2018-06-21 15:22:30 +0200
committerAlbin Larsson <mail@albinlarsson.com>2018-06-21 15:22:30 +0200
commit81c5477f1d9ac2539e4ec50ede7886abe50fa75a (patch)
treec6770f2b726091d7e5b3356dad0549945224eb0c /src
parent20f2ddc11db39fd19f395cf4967fb5dcbcc9d5ca (diff)
downloadplyr-81c5477f1d9ac2539e4ec50ede7886abe50fa75a.tar.lz
plyr-81c5477f1d9ac2539e4ec50ede7886abe50fa75a.tar.xz
plyr-81c5477f1d9ac2539e4ec50ede7886abe50fa75a.zip
Fix captions.toggle() if there is no toggle button
Diffstat (limited to 'src')
-rw-r--r--src/js/captions.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/js/captions.js b/src/js/captions.js
index 732b2e38..9dca5505 100644
--- a/src/js/captions.js
+++ b/src/js/captions.js
@@ -191,8 +191,10 @@ const captions = {
return;
}
- // Toggle state
- this.elements.buttons.captions.pressed = active;
+ // Toggle button if it's enabled
+ if (this.elements.buttons.captions) {
+ this.elements.buttons.captions.pressed = active;
+ }
// Add class hook
toggleClass(this.elements.container, activeClass, active);