[jQuery] handle trigger return value

[jQuery] handle trigger return value


Hi folks,
I'm developing a plugin (my first evel jQuery plugin), and I want to
capture the return value from a user function, bound to event.
Basically, what I want is to be able to undo the event - like
returning false in a link click will now follow the link.
Here is some code:
// in the plugin
self.click(function () {
    var return_value = self.trigger('action', [currentProgress]));
    if (!return_value) undo();
});
// userland
$('#item').bind('action', function () {
    return window.confirm('Sure?');
});
Regards,
Emil Ivanov