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

Commit

Permalink
Now adds ARIA role attribute to document body if not already present
Browse files Browse the repository at this point in the history
http://wiki.jqueryui.com/Tooltip - 4.3 Accessibility recommendation
  • Loading branch information
Craga89 committed Sep 6, 2010
1 parent 1553d16 commit 451251f
Show file tree
Hide file tree
Showing 5 changed files with 38 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: Mon Sep 6 13:29:36 2010 +0100
* Date: Mon Sep 6 13:58:33 2010 +0100
*/

.ui-tooltip-accessible{
Expand Down
15 changes: 12 additions & 3 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: Mon Sep 6 13:29:36 2010 +0100
* Date: Mon Sep 6 13:58:33 2010 +0100
*/

"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 @@ -1284,15 +1284,18 @@ $.fn.qtip.bind = function(opts)
});
};

// Override some of the core jQuery methods for library-specific purposes
$.each({
/* Allow other plugins to successfully retrieve the title of an element with a qTip applied */
attr: function(attr) {
var api = $(this).data('qtip');
return (arguments.length === 1 && attr === 'title' && api && api.rendered === TRUE) ? $(this).data('oldtitle') : NULL;
},

/* Taken directly from jQuery 1.8.2 widget source code */
/* Trigger 'remove' event on all elements on removal if jQuery UI isn't present */
/*
* Taken directly from jQuery 1.8.2 widget source code
* Trigger 'remove' event on all elements on removal if jQuery UI isn't present
*/
remove: $.ui ? NULL : function( selector, keepData ) {
this.each(function() {
if (!keepData) {
Expand All @@ -1313,6 +1316,12 @@ function(name, func) {
};
});

/*
* Add ARIA role attribute to document body if not already present
* http://wiki.jqueryui.com/Tooltip - 4.3 Accessibility recommendation
*/
$(document.body).attr('role', function(i, val) { return !val ? 'application' : val; });

// Set global qTip properties
$.fn.qtip.nextid = 0;
$.fn.qtip.inactiveEvents = 'click dblclick mousedown mouseup mousemove mouseleave mouseenter'.split(' ');
Expand Down
24 changes: 12 additions & 12 deletions dist/jquery.qtip.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 451251f

Please sign in to comment.