diff options
author | Albin Larsson <mail@albinlarsson.com> | 2018-06-21 15:22:30 +0200 |
---|---|---|
committer | Albin Larsson <mail@albinlarsson.com> | 2018-06-21 15:22:30 +0200 |
commit | 81c5477f1d9ac2539e4ec50ede7886abe50fa75a (patch) | |
tree | c6770f2b726091d7e5b3356dad0549945224eb0c /src | |
parent | 20f2ddc11db39fd19f395cf4967fb5dcbcc9d5ca (diff) | |
download | plyr-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.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); |