acidrain / bubbletip

Automatically exported from code.google.com/p/bubbletip
0 stars 0 forks source link

error $(tip).get(0).id is undefined when calling bubbletip() multiple times #5

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use bubbletips qith qunit
2. $("somelement").bubbletip gets called multiple times
3. suddenly the list sent in is empty. 

What is the expected output? What do you see instead?
I get an error $(tip).get(0).id is undefined

What version of the product are you using? On what operating system?
1.0.5

Please provide any additional information below.
This patch should fix it:
Index: js/jQuery.bubbletip-1.0.5.js
===================================================================
--- js/jQuery.bubbletip-1.0.5.js    (revision 505)
+++ js/jQuery.bubbletip-1.0.5.js    (working copy)
@@ -28,6 +28,9 @@
    var bindIndex = 0;
    $.fn.extend({
        bubbletip: function(tip, options) {
+
+            // if tip is empty, then it is allready initialized so we let
it pass
+            if ($(tip).length == 0 ) return this;
            // check to see if the tip is a descendant of 
            // a table.bubbletip element and therefore
            // has already been instantiated as a bubbletip
@@ -371,4 +374,4 @@
            return this;
        }
    });
-})(jQuery);
\ No newline at end of file
+})(jQuery);

Original issue reported on code.google.com by tarjei.h...@gmail.com on 18 Feb 2010 at 10:34

GoogleCodeExporter commented 8 years ago

Original comment by uhle...@gmail.com on 16 Mar 2010 at 1:47

GoogleCodeExporter commented 8 years ago
What is the status of this issue? I have the same problems her?

Original comment by jurianku...@gmail.com on 3 Jun 2011 at 2:29

GoogleCodeExporter commented 8 years ago
Any Update on This?? Need it working ASAP, and have same problem reported here.

Original comment by do...@cogentmediagroup.com on 7 Sep 2011 at 5:21

GoogleCodeExporter commented 8 years ago
Thanks for your guidance, my problem is solved

Original comment by mohs...@gmail.com on 2 Mar 2012 at 7:18

GoogleCodeExporter commented 8 years ago
Thanks for the patch.  In case you're not understanding what to do, simply 
comment out lines 21,22,23 jQuery.bubbletip-1.0.6.js and paste the conditional 
check supplied by the OP.  At least that's what worked for me.

line 21 //          if ($('table.bubbletip #' + $(tip).get(0).id).length > 0) {
line 22 //              return this;
line 23//           }
line 24                        if ($(tip).length == 0 ) return this;

Original comment by neuenk...@gmail.com on 8 Oct 2012 at 6:38