From 0b4746fce61c5d74fed8d441e80049707e0a0e84 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Sat, 13 May 2023 19:01:40 +0200 Subject: [PATCH] jQuery.fn.href2delete pass vars with indexValue --- lib/js/nb.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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'); } - }); + }) }); }); } -- 2.47.3