[wp-trac] [WordPress Trac] #19189: thickbox.js .trigger("unload") causes conflicts

WordPress Trac wp-trac at lists.automattic.com
Thu Nov 24 18:56:16 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 azaozz):

 Replying to [comment:20 aesqe]:
 > Could this please be changed into a custom .trigger() event? Because it
 looks like .triggerHandler("unload") does nothing at all in 3.3-beta4 with
 jQuery 1.7.1.

 This seems to work properly in 3.3-beta4 with jQuery 1.7.1:
 {{{
 jQuery('#TB_window').unload(function(e){
   console.log(e);
 });
 }}}

 > Also, .triggerHandler() doesn't work with .live(), so what's the point
 of having it there, anyway?

 This is a jQuery limitation/decision. Actually `.live()` is being phased
 out in favor of `.delegate()`.

 > 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.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19189#comment:21>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list