Merge pull request #888 from Antonio-Laguna/master

Safer check for active caption
This commit is contained in:
Sam Potts
2018-04-11 23:42:40 +10:00
committed by GitHub

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