aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/captions.js
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2018-06-22 08:19:33 +1000
committerGitHub <noreply@github.com>2018-06-22 08:19:33 +1000
commit86406ee59a7b0cc45afcfd20cbfb8075ce61ad62 (patch)
tree8e89953d6239352ed4ae84cf5d6b9c308d3dc679 /src/js/captions.js
parente04b90c9c030bf5629e034f616a636245770a8d1 (diff)
parent81c5477f1d9ac2539e4ec50ede7886abe50fa75a (diff)
downloadplyr-86406ee59a7b0cc45afcfd20cbfb8075ce61ad62.tar.lz
plyr-86406ee59a7b0cc45afcfd20cbfb8075ce61ad62.tar.xz
plyr-86406ee59a7b0cc45afcfd20cbfb8075ce61ad62.zip
Merge pull request #1061 from friday/captions-no-toggle-button
Fix captions.toggle() if there is no toggle button
Diffstat (limited to 'src/js/captions.js')
-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);