[wp-trac] [WordPress Trac] #19189: thickbox.js .trigger("unload") causes conflicts
WordPress Trac
wp-trac at lists.automattic.com
Fri Nov 25 10:19:07 UTC 2011
#19189: thickbox.js .trigger("unload") causes conflicts
----------------------------+---------------------
Reporter: ocean90 | Owner: azaozz
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 3.3
Component: Administration | Version: 3.3
Severity: major | Resolution: fixed
Keywords: has-patch |
----------------------------+---------------------
Comment (by aesqe):
Replying to [comment:21 azaozz]:
> This seems to work properly in 3.3-beta4 with jQuery 1.7.1:
> {{{
> jQuery('#TB_window').unload(function(e){
> console.log(e);
> });
> }}}
Ugh, that doesn't work for me - I've tried it in latest Firefox, Chrome
and Opera and nothing shows up in the console log. It only works if I
change it to trigger('unload') in thickbox.js and use live() to bind it.
I've used a fresh WP3.3-beta4 install, no WP plugins, no browser plugins.
And isn't .unload() just an alias of bind("unload")? How can it then be
bound to an element that's not been created yet? :|
> > Before 3.3-beta4 and jQuery 1.7.1,
$("#TB_window").triggerHandler("unload") was registered with
window.unload, now it's not :/
>
> Don't think so. The `unload` event only fires on `window`. The bug in
Thickbox was that it used to fire `unload` on a div which then propagated
to `window` and tricked all handlers on `jQuery(window).unload()` into
running despite that the window didn't unload.
>
> .triggerHandler() doesn't propagate up the DOM.
Sorry about that, you're right, that worked on 3.2.1, not on 3.3.
>
> I see the problems in trying to use the Thickbox unload. Wondering if
it's possible to both keep full back-compat and avoid triggering
window.unload at the same time. Custom event would work but will require
all plugins that use it to be updated.
Thanks :)
--
Ticket URL: <http://core.trac.wordpress.org/ticket/19189#comment:23>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list