Is there a callback to get the dismissed element ?
How would you want this callback to be structured?
Hi! do we have this callback for dismissable collection. Like when i dismiss an item..i can call my function to also delete that item in my database.. thanks
Hey everyone! I found this workaround and using it for the time being. I'm posting this for others that need this hack. I found this in StackOverflow..here's the link http://stackoverflow.com/questions/2200494/jquery-trigger-event-when-an-element-is-removed-from-the-dom
I love this framework..I'll definitely donate when I sold my first app using Materializecss..Keep it up!
(function() {
var ev = new $.Event('remove'),
orig = $.fn.remove;
$.fn.remove = function() {
$(this).trigger(ev);
return orig.apply(this, arguments);
}
})();
$('.dismissable').bind('remove', function() {
console.log('removed!');
// do pre-mortem stuff here
// 'this' is still a reference to the element, before removing it
});
Thanks for the workaround.
It would be fantastic, if materialize could provide us with a callback. I'd need to know the element that has been swiped and the direction (left or right), so I can trigger a different action accordingly. An example would be an email inbox, where swiping left could trigger a delete, while swiping right could trigger a "remind me later" action. In both cases would the visual list item be removed from the DOM afterwards.
transitions.js has been removed for 1.0
Most helpful comment
Hey everyone! I found this workaround and using it for the time being. I'm posting this for others that need this hack. I found this in StackOverflow..here's the link http://stackoverflow.com/questions/2200494/jquery-trigger-event-when-an-element-is-removed-from-the-dom
I love this framework..I'll definitely donate when I sold my first app using Materializecss..Keep it up!