Skip to content

Instantly share code, notes, and snippets.

@dimaShin
Last active February 26, 2016 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dimaShin/b82bc7b27299f2b390ad to your computer and use it in GitHub Desktop.
Save dimaShin/b82bc7b27299f2b390ad to your computer and use it in GitHub Desktop.
Counter.prototype.del = function(target){
var self = this;
var tr = $(target).closest('tr');
var undo = tr.find('.undo-button');
undo.css('display', 'block');
undo.one('click', function () {
clearTimeout(timeout);
undo.css('display', 'none');
})
var timeout = setTimeout(function () {
showNoti();
var tr = $(target).closest('tr');
tr.remove();
self.updateView();
}, 10000);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment