nathanvda/cocoon — pull request #203 by BroiSatse (2014-03-11 16:15:26+00:00)
Title: Allow before events to interrupt inserting or removing process.

Currently there is no easy way to interrupt cocoon insertion or deletion with, for example, confirmation. This pull request adds this functionality by manipulating an extra object passed to all eventHandlers. With this it is possible for example to write:

$(document).bind('cocoon:before-remove', function(e, object, remove) {
remove.val = remove.val && confirm('Are you sure you want to remove this record?');
}