Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single tooltip element not used since tipClass (1.2.0) #162

Closed
rleonhardt opened this issue Sep 7, 2010 · 1 comment
Closed

Single tooltip element not used since tipClass (1.2.0) #162

rleonhardt opened this issue Sep 7, 2010 · 1 comment

Comments

@rleonhardt
Copy link

My triggers have title attributes and I am using a single { tip: '#tooltip'} div.
Since tipClass has been introduced, nevertheless a new div.tooltip is created for every trigger.
When I switch the if clause priority and set the corresponding title myself, the single div#tooltip is being used again and no div.tooltip nodes are being created anymore, as it was before 1.2.0.

Patch:

--- src/tooltip/tooltip.js      2010-09-04 18:51:56.000000000 +0200
+++ build/1.2.4/tooltip/tooltip.js      2010-09-07 12:35:23.000000000 +0200
@@ -173,15 +172,15 @@
                                        if (tipAttr) {
                                                tip = $(tipAttr);

+                                       // single tip element for all
+                                       } else if (conf.tip) {
+                                               tip = $(conf.tip).eq(0);
+
                                        // autogenerated tooltip
                                        } else if (title) {
                                                tip = $(conf.layout).addClass(conf.tipClass).appendTo(document.body)
                                                        .hide().append(title);

-                                       // single tip element for all
-                                       } else if (conf.tip) {
-                                               tip = $(conf.tip).eq(0);
-
                                        // manual tooltip
                                        } else {
                                                tip = trigger.next();
@@ -199,6 +198,9 @@
                                // get position
                                var pos = getPosition(trigger, tip, conf);

+                               // restore title for single tooltip element
+                               if (conf.tip)
+                                       tip.html(trigger.data("title"));

                                // onBeforeShow
                                e = e || $.Event();
@tipiirai
Copy link
Contributor

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants