Fix captions.toggle() if there is no toggle button

This commit is contained in:
Albin Larsson 2018-06-21 15:22:30 +02:00
parent 20f2ddc11d
commit 81c5477f1d

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