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
commit 86406ee59a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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