Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Links: Append popup accessibility attributes. Fixes #5898.
Browse files Browse the repository at this point in the history
(cherry picked from commit ab910d3)
  • Loading branch information
Gabriel Schulhof committed Apr 18, 2013
1 parent 089fecb commit 252634e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions js/jquery.mobile.links.js
Expand Up @@ -14,6 +14,24 @@ $( document ).bind( "pagecreate create", function( e ) {
$( e.target )
.find( "a" )
.jqmEnhanceable()
.filter( ":jqmData(rel='popup')[href][href!='']" )
.each( function() {
// Accessibility info for popups
var e = this,
href = $( this ).attr( "href" );

e.setAttribute( "aria-haspopup", true );
e.setAttribute( "aria-owns", href );
e.setAttribute( "aria-expanded", false );
$( document )
.on( "popupafteropen", href, function() {
e.setAttribute( "aria-expanded", true );
})
.on( "popupafterclose", href, function() {
e.setAttribute( "aria-expanded", false );
});
})
.end()
.not( ".ui-btn, .ui-link-inherit, :jqmData(role='none'), :jqmData(role='nojs')" )
.addClass( "ui-link" );

Expand Down

0 comments on commit 252634e

Please sign in to comment.