aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.tooltip.js
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2012-05-14 11:52:47 +0200
committerFelix Nagel <info@felixnagel.com>2012-05-14 11:52:47 +0200
commitc6a8d7ee3c9803d9944db6f55778810592a36452 (patch)
treeabb3df79a0eb6d9bb4713ab73da8ddc60d8a7674 /ui/jquery.ui.tooltip.js
parent41dfb09aeb5df7d53089b58959d21207de63edbe (diff)
parentd393c8b4cb26ec34878c22202da6ba9393e0094d (diff)
downloadjquery-ui-c6a8d7ee3c9803d9944db6f55778810592a36452.tar.gz
jquery-ui-c6a8d7ee3c9803d9944db6f55778810592a36452.zip
Merge branch 'master' into selectmenu
Diffstat (limited to 'ui/jquery.ui.tooltip.js')
-rw-r--r--ui/jquery.ui.tooltip.js19
1 files changed, 12 insertions, 7 deletions
diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js
index 97895a6a8..47a377bfd 100644
--- a/ui/jquery.ui.tooltip.js
+++ b/ui/jquery.ui.tooltip.js
@@ -5,8 +5,6 @@
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
- * http://docs.jquery.com/UI/Tooltip
- *
* Depends:
* jquery.ui.core.js
* jquery.ui.widget.js
@@ -130,11 +128,15 @@ $.widget( "ui.tooltip", {
// we have to check first to avoid defining a title if none exists
// (we don't want to cause an element to start matching [title])
- // We don't use removeAttr as that causes the native tooltip to show
- // up in IE (9 and below, didn't yet test 10). Happens only when removing
- // inside the mouseover handler.
+ // We use removeAttr only for key events, to allow IE to export the correct
+ // accessible attributes. For mouse events, set to empty string to avoid
+ // native tooltip showing up (happens only when removing inside mouseover).
if ( target.is( "[title]" ) ) {
- target.attr( "title", "" );
+ if ( event && event.type === "mouseover" ) {
+ target.attr( "title", "" );
+ } else {
+ target.removeAttr( "title" );
+ }
}
// ajaxy tooltip can update an existing one
@@ -181,7 +183,10 @@ $.widget( "ui.tooltip", {
// don't close if the element has focus
// this prevents the tooltip from closing if you hover while focused
- if ( !force && this.document[0].activeElement === target[0] ) {
+ // we have to check the event type because tabbing out of the document
+ // may leave the element as the activeElement
+ if ( !force && event && event.type !== "focusout" &&
+ this.document[0].activeElement === target[0] ) {
return;
}