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

View File

@ -845,7 +845,7 @@ class Plyr {
} }
// If the method is called without parameter, toggle based on current value // 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... // Nothing to change...
if (this.captions.active === show) { if (this.captions.active === show) {