arrive
arrive copied to clipboard
The first argument to 'leave' event should be optional
So, to listen for removal of .test-elem
, one can simply write:
$(".test-elem").leave(function() {
var removedElem = this;
});
instead of:
$(".container-1").leave(".test-elem", function() {
var removedElem = this;
});
A test case fails for the issue when some parent element of the target element gets removed from DOM. That's because we attach mutation event to parent element and when parent element directly gets removed the mutation event does not fire.
Any suggestion is welcome.
@uzairfarooq Is there a reason why the event handler is not attached to the document element? Performance reasons?
@matt-curtis wanted to avoid that for performance reasons but I guess it's okay to attach it to document element as I don't see any other solution.