Safer check for active caption

This commit is contained in:
Antonio Laguna 2018-04-11 15:39:12 +02:00
parent 9b7170834e
commit 72155472dd
No known key found for this signature in database
GPG Key ID: 68AF035D4599B183

View File

@ -845,7 +845,7 @@ class Plyr {
}
// If the method is called without parameter, toggle based on current value
const show = utils.is.boolean(input) ? input : this.elements.container.className.indexOf(this.config.classNames.captions.active) === -1;
const show = utils.is.boolean(input) ? input : !this.elements.container.classList.contains(this.config.classNames.captions.active);
// Nothing to change...
if (this.captions.active === show) {