Bug Tracker

Opened 11 years ago

Closed 11 years ago

#11028 closed bug (invalid)

$.event.handle stopped working on jQuery 1.7.x

Reported by: [email protected] Owned by: [email protected]
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:



I have a jQuery plugin, Lightbox from Balupton, that is being used by many Wordpress users (and I really mean MANY USERS!!!)

It worker fine with jQuery 1.6.4, but since 1.7 it stopped working correctly...

I managed to narrow the issue to the usage of $.event.handle.apply that seems to do nothing!

I've set two samples online for you to check it out here (with jQuery 1.6.4 and 1.7.1): http://dl.dropbox.com/u/28356/jquerybug/index.htm

Can you help me with this please?

Best regards,

Pedro Lamas

Change History (6)

comment:1 Changed 11 years ago by dmethvin

Resolution: invalid
Status: newclosed

You would need to contact the author of the plugin. The address in the plugin seems to be dead, http://www.balupton.com/projects/jquery-lightbox, but Google says this is the place to go.


comment:2 Changed 11 years ago by [email protected]

There is something I think skipped you: I think Balupton stopped developing this plugin so currently, I'M THE DEVELOPER!

I've maintained the plugin on a personal forked GitHub branch from the main one, and so far I managed to get it working quite well, but then came jQuery 1.7.X and all hell broke loose... :(

comment:3 Changed 11 years ago by dmethvin

Resolution: invalid
Status: closedreopened

comment:4 Changed 11 years ago by dmethvin

Owner: set to [email protected]
Status: reopenedpending

It wasn't clear from the description that you were the developer.

I took a quick look, and the thing I see that is immediately wrong is that you are trying to hold onto the event object after the event has been fired and use it on a timeout. The consequences of doing that are undefined. In IE<9 specifically, the native window.event object is invalid once the event handler has returned for example.

The plugin is much too big to debug, and I am not sure what I am supposed to be seeing. All I know is that you have said it "stopped working correctly".

Can you provide a reduced test case? Just strip out all the unused code in your plugin so it is possible to see what code is involved.

comment:5 Changed 11 years ago by [email protected]

Status: pendingnew

First of all, thank you for your help! :) Well, you nailed what it's being done there, and I found how to fix (though it's not really a good fix): On line 642 of the plugin js file I have this:

event.type = 'lastclick';
$.event.handle.apply(Me, [event,clicks])

I just changed those two to this:

event.type = 'lastclick';
event.isPropagationStopped = function() { return false };
$.event.handle.apply(Me, [event,clicks])

So, I just reseted the isPropagationStopped and sudently it started working fine! :)

I guess the change from jQuery 1.7 to the previous versions has something to do with the event propagation, but I really don't know what it is!

Right now the plugin is working again, and the users seems to confirm it! :)

comment:6 Changed 11 years ago by dmethvin

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.