Skip to content

Commit e0a1e8f

Browse files
committed
If event triggered from outside the player by a button with no classes, $.attr('class') would be undefined
1 parent 0dabb47 commit e0a1e8f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎scripts/event.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ function addEventFunctions(AblePlayer) {
229229
if ( this.$focusedElement && null !== this.activeMedia ) {
230230
$mediaParent = $( '#' + this.activeMedia ).closest( '.able' );
231231
if ( ( this.$focusedElement).is('button') ) {
232-
classList = this.$focusedElement.attr("class").split(/\s+/);
232+
classList = this.$focusedElement.attr("class");
233+
classList = ( typeof classList === 'string' ) ? classList.split(/\s+/) : [];
233234
$.each(classList, function(index, item) {
234235
if (item.substring(0,20) === 'able-button-handler-') {
235236
$mediaParent.find('div.able-controller div.' + item).trigger('focus');

0 commit comments

Comments
 (0)