You will recieve your password to this address. Address is not made public.

Your preferred username that is used when logging in.

Fix for Click on/off trigger and tip elements not responding v1.1.3 Created Jan 9, 2010

This thread is solved

Views: 1579     Replies: 3     Last reply Aug 30, 2010  
You must login first before you can use this feature

jtnix

Posts: 7

Registered:
Dec 17, 2009

Fix for Click on/off trigger and tip elements not responding v1.1.3

Posted: Jan 9, 2010

First, thanks for this plugin - it is nice and lightweight, with decent features.

I have a client who wanted a popup to appear only when the trigger element is clicked, in toggle fashion, and ran into a few problems using this plug that way and found some solutions, but I had to modify the v1.1.3 code to make it all work. Here's what happend:

In the test I made, when a config of event:{def:'click,click'} was used the element would show and then quickly hide the element upon click. Changing it to event:{def:'click,'} worked; without the trailing comma, an error was thrown. This seems contrary behavior to the documentation.

When I tried it on my client's dev site, this behavior broke. Everytime I mouseovered the trigger elements, tooltip would show the popup, which was not the click only behavior I assigned it. This took me a long time to track it down, but I finally found line 362 of tooltip v1.1.3 code and disabled this it and everything worked again; automatic Lazy loading with over 20 elements was causing the problem. I don't know why this line is in here, because the plugin works fine with it disabled, even with default settings. It is essentially forcing a tip.show on all mouseover events when lazy load is turned on, which then overrides the already bound trigger show events.

The other problem I ran into is for some strange reason all of the events on the tip element were being flagged PreventDefault, preventing either of these events from being triggered, despite binding. This is only happening on my client's codebase and is more than confusing. I really don't have any experience with PreventDefault event tagging or why it would be happening only on my client's server and not in my tests or the samples presented online. In the end my solution was to comment line 218 and line 262 of tooltip v1.1.3. Perhaps this could be a conf disabled 'feature' for people using strange systems? If anyone has any ideas how PreventDefault could be set on an Event in the global space - I can't imagine! causing this problem?! I would love to hear it because I am clueless.

PS: I wish the tooltip.dynamic plugin worked with Lazy loading and when CSS height is undefined.

Jt

jtnix

Posts: 7

Registered:
Dec 17, 2009

exceptions on IE 6 & 7 + Fixes

Posted: Jan 9, 2010

Reply to: Fix for Click on/off trigger and tip elements not responding v1.1.3, from jtnix
Just when I thought this was done, I tested the site on IE 6 & 7 and neither of them worked.

I found line 141 of tooltip v1.1.3 needed to be commented - IE wasn't fooled by my trailing comma and wasn't creating the 2nd array element so tooltip was throwing that error.

That wasn't all - jQuery doesn't like binding to an empty event on IE either, so I had to change line 166 to:

if(evt[1]) trigger.bind(evt[1], function(e) {

With this patch, a trailing comma is no longer needed in the event{def:} field if you do not want a hide event attached to the trigger.

These would both be nice patches for the next release. :)

insidion

Posts: 2

Registered:
Aug 30, 2010

Was this fixed? Can you

Posted: Aug 30, 2010

Reply to: exceptions on IE 6 & 7 + Fixes, from jtnix
I'm attempting to create similar functionality that you describe in your first post - do you know if the issue was fixed?

jtnix

Posts: 7

Registered:
Dec 17, 2009

not sure if latest version fixes this

Posted: Aug 30, 2010

Reply to: Was this fixed? Can you , from insidion
No, actually our company moved to Qtip - although it is much larger code size, it was much easier to customize for our purposes.