- if ( !parts[1] || handler.type == parts[1] ) {
- var ret = handler.apply( this, args );
+ if ( all || handler.type == namespace ) {
+ // Pass in a reference to the handler function itself
+ // So that we can later remove it
+ event.handler = handler;
+ event.data = handler.data;
+
+ ret = handler.apply( this, arguments );