From d074efe5289db4f5182a685046e9b9ad6186ac26 Mon Sep 17 00:00:00 2001 From: Scott González Date: Sun, 28 Oct 2012 20:28:55 -0400 Subject: Tooltip: Use attributes, not properties, when checking for parent tooltips. Fixes #8742 - Tooltip shows incorrect message in chrome if there is input with name='title' in a form. --- ui/jquery.ui.tooltip.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'ui') diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js index f1f919ad3..c05be1d45 100644 --- a/ui/jquery.ui.tooltip.js +++ b/ui/jquery.ui.tooltip.js @@ -164,19 +164,20 @@ $.widget( "ui.tooltip", { // kill parent tooltips, custom or native, for hover if ( event && event.type === "mouseover" ) { target.parents().each(function() { - var blurEvent; - if ( $( this ).data( "tooltip-open" ) ) { + var parent = $( this ), + blurEvent; + if ( parent.data( "tooltip-open" ) ) { blurEvent = $.Event( "blur" ); blurEvent.target = blurEvent.currentTarget = this; that.close( blurEvent, true ); } - if ( this.title ) { - $( this ).uniqueId(); + if ( parent.attr( "title" ) ) { + parent.uniqueId(); that.parents[ this.id ] = { element: this, - title: this.title + title: parent.attr( "title" ) }; - this.title = ""; + parent.attr( "title", "" ); } }); } @@ -334,7 +335,7 @@ $.widget( "ui.tooltip", { if ( event && event.type === "mouseleave" ) { $.each( this.parents, function( id, parent ) { - parent.element.title = parent.title; + $( parent.element ).attr( "title", parent.title ); delete that.parents[ id ]; }); } -- cgit v1.2.3