Tooltips now properly disappear when another text box with a tooltip has been highlighted.
authorLennard de Rijk <ljvderijk@gmail.com>
Fri, 16 Jan 2009 17:52:42 +0000
changeset 815 7b8c65531fbd
parent 814 25ffebd9fa8f
child 816 9d61cbc9d013
Tooltips now properly disappear when another text box with a tooltip has been highlighted. Also known as Issue 132. Patch by: Mario Ferraro Reviewed by: Lennard de Rijk
app/jquery/jquery-bt-0.7.js
--- a/app/jquery/jquery-bt-0.7.js	Thu Jan 15 17:01:15 2009 +0000
+++ b/app/jquery/jquery-bt-0.7.js	Fri Jan 16 17:52:42 2009 +0000
@@ -118,8 +118,13 @@
     var contentSelect = false;
   }
 
+  var tooltips_pool = [];
+
+
   return this.each(function(index) {
 
+    tooltips_pool.push(this);
+
     var opts = jQuery.extend(false, jQuery.fn.bt.defaults, options);
 
     // clean up the options
@@ -129,6 +134,10 @@
 
     var turnOn = function () {
 
+      for (var x in tooltips_pool) {
+        turnOff.apply(tooltips_pool[x]);
+      }
+
       if (typeof $(this).data('bt-box') == 'object') {
         // if there's already a popup, remove it before creating a new one.
         turnOff.apply(this);