Merge pull request #1061 from friday/captions-no-toggle-button

Fix captions.toggle() if there is no toggle button
This commit is contained in:
Sam Potts
2018-06-22 08:19:33 +10:00
committed by GitHub

View File

@ -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);