Skip to content

Commit

Permalink
Menu: Fixed JS error when AJAXed-in menu is prevented from loading du…
Browse files Browse the repository at this point in the history
…e to security restrictions
  • Loading branch information
Paul Jackson authored and Paul Jackson committed Jan 20, 2014
1 parent 74f1d15 commit 41830a6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/plugins/menu/menu.js
Expand Up @@ -303,12 +303,14 @@ var pluginName = "wb-menu",
.find( ":discoverable" )
.attr( "tabindex", "-1" );

$menu[ 0 ].setAttribute( "tabindex", "0" );
$menu
.filter( "[href^=#]" )
.append( "<span class='expicon'></span>" );
if ( $menu.length !== 0 ) {
$menu[ 0 ].setAttribute( "tabindex", "0" );
$menu
.filter( "[href^=#]" )
.append( "<span class='expicon'></span>" );

drizzleAria( $menu );
drizzleAria( $menu );
}

// Replace elements
$elm.html( $ajaxed.html() );
Expand Down

0 comments on commit 41830a6

Please sign in to comment.