diff options
author | Sam Potts <sam@potts.es> | 2018-06-22 08:19:33 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-22 08:19:33 +1000 |
commit | 86406ee59a7b0cc45afcfd20cbfb8075ce61ad62 (patch) | |
tree | 8e89953d6239352ed4ae84cf5d6b9c308d3dc679 | |
parent | e04b90c9c030bf5629e034f616a636245770a8d1 (diff) | |
parent | 81c5477f1d9ac2539e4ec50ede7886abe50fa75a (diff) | |
download | plyr-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
-rw-r--r-- | src/js/captions.js | 6 |
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); |