This commit is contained in:
Sam Potts
2018-08-14 11:17:33 +10:00
parent 7a43649c13
commit eaeccd66ae
12 changed files with 33 additions and 17 deletions

12
dist/plyr.js vendored
View File

@ -2942,8 +2942,7 @@ typeof navigator === "object" && (function (global, factory) {
// Add pressed property to buttons
if (!is.empty(this.elements.buttons)) {
// Toggle classname when pressed property is set
Object.values(this.elements.buttons).filter(Boolean).forEach(function (button) {
var addProperty = function addProperty(button) {
var className = _this10.config.classNames.controlPressed;
Object.defineProperty(button, 'pressed', {
enumerable: true,
@ -2956,6 +2955,15 @@ typeof navigator === "object" && (function (global, factory) {
toggleClass(button, className, pressed);
}
});
};
// Toggle classname when pressed property is set
Object.values(this.elements.buttons).filter(Boolean).forEach(function (button) {
if (is.array(button)) {
button.filter(Boolean).forEach(addProperty);
} else {
addProperty(button);
}
});
}