-function liveHandler( event ){
- var check = RegExp("(^|\\.)" + event.type + "(\\.|$)"),
- stop = true;
+function liveHandler( event ) {
+ var stop = true, elems = [], args = arguments;
+
+ jQuery.each( jQuery.data( this, "events" ).live || [], function( i, fn ) {
+ if ( fn.live === event.type ) {
+ var elem = jQuery( event.target ).closest( fn.selector )[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" );
+ });