From: Nicolas Boisselier Date: Sat, 13 May 2023 17:01:40 +0000 (+0200) Subject: jQuery.fn.href2delete pass vars with indexValue X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=0b4746fce61c5d74fed8d441e80049707e0a0e84;p=nb.git jQuery.fn.href2delete pass vars with indexValue --- diff --git a/lib/js/nb.js b/lib/js/nb.js index e2db5637..cd4a28de 100644 --- a/lib/js/nb.js +++ b/lib/js/nb.js @@ -637,20 +637,19 @@ jQuery.fn.href2delete = function(minus_one,minus_one_re) { $(this).click(function(){ $(this).addClass('loading'); - // NB 13.05.23 $(this).parent().parent().remove(); $.ajax({ url: href, type: 'GET', + indexValue: {item: this, href: href}, success: function(result) { if (minus_one) $(minus_one).numAdd(-1,minus_one_re); - $(this).parent().parent().remove(); - $(this).removeClass('loading'); + $(this.indexValue.item).parent().parent().remove(); }, error: function (xhr, status, error) { - $(this).removeClass('loading'); - alert(status+' '+xhr.status+' '+error); + alert(status+' '+xhr.status+' '+error+'\n'+href); + $(this.indexValue.item).removeClass('loading'); } - }); + }) }); }); }