Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

Commit

Permalink
role="alert" instead of tooltip is now applied to tooltips. tabIndex=…
Browse files Browse the repository at this point in the history
…-1 is also set on the toolti pon focus so screen readers can correctly focus them for reading.
  • Loading branch information
Craga89 committed Jan 5, 2011
1 parent 2d938e9 commit 2c94303
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 20 deletions.
2 changes: 1 addition & 1 deletion dist/jquery.qtip.css
Expand Up @@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Wed Jan 5 19:34:56 2011 +0000
* Date: Wed Jan 5 19:39:49 2011 +0000
*/

/* Fluid class for determining actual width in IE */
Expand Down
6 changes: 4 additions & 2 deletions dist/jquery.qtip.js
Expand Up @@ -9,7 +9,7 @@
* http://en.wikipedia.org/wiki/MIT_License
* http://en.wikipedia.org/wiki/GNU_General_Public_License
*
* Date: Wed Jan 5 19:34:56 2011 +0000
* Date: Wed Jan 5 19:39:49 2011 +0000
*/

"use strict"; // Enable ECMAScript "strict" operation for this function. See more: http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
Expand Down Expand Up @@ -613,7 +613,7 @@ function QTip(target, options, id)
elements.tooltip = $('<div/>')
.attr({
'id': uitooltip + '-'+id,
'role': 'tooltip',
'role': 'alert', // Apparently "tooltip" doesn't work too well... so we'll use alert
'class': uitooltip + ' qtip ui-helper-reset ' + options.style.classes,
'aria-describedby': uitooltip + '-' + id + '-content'
})
Expand Down Expand Up @@ -908,6 +908,7 @@ function QTip(target, options, id)
// Reduce our z-index's and keep them properly ordered
qtips.each(function() {
this.style.zIndex = this.style.zIndex - 1;
this.removeAttribute('tabIndex');
});

// Fire blur event for focussed tooltip
Expand All @@ -933,6 +934,7 @@ function QTip(target, options, id)
// Set the new z-index and set focus status to TRUE if callback wasn't FALSE
if(!callback.isDefaultPrevented()) {
tooltip.addClass(focusClass)[0].style.zIndex = newIndex;
tooltip[0].tabIndex = -1;
}
}

Expand Down

0 comments on commit 2c94303

Please sign in to comment.