-function liveHandler( event ){
- var check = RegExp("(^|\\.)" + event.type + "(\\.|$)"),
- stop = true;
+function liveHandler( event ) {
+ var check = new RegExp("(^|\\.)" + event.type + "(\\.|$)"),
+ stop = true, elems = [];
+
+ jQuery.each( jQuery.data( this, "events" ).live || [], function( i, fn ) {
+ if ( check.test( fn.type ) ) {
+ var elem = jQuery( event.target ).closest( fn.data )[0];
+ if ( elem ) {
+ elems.push({ elem: elem, fn: fn });
+ }
+ }
+ });
+
+ elems.sort(function( a, b ) {
+ return jQuery.data( a.elem, "closest" ) - jQuery.data( b.elem, "closest" );
+ });