From 197d15b7de34c670934cfe873e7c67233e090009 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 29 Jun 2021 09:53:40 +0000 Subject: only remove elements after the delete has happened --- view/js/main.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'view/js') diff --git a/view/js/main.js b/view/js/main.js index 9ef81b72c..f427df8ad 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1284,18 +1284,18 @@ function dropItem(url, object, b64mid) { $.get(url, function() { $(object + ', #pinned-wrapper-' + id).remove(); $('body').css('cursor', 'auto'); + + if (typeof b64mid !== typeof undefined) { + $('[data-b64mid=\'' + b64mid + '\']').fadeOut(function() { + this.remove(); + }); + } }); if($('#wall-item-pinned-' + id).length) { $.post('pin/pin', { 'id' : id }); } - if (typeof b64mid !== typeof undefined) { - $('[data-b64mid=\'' + b64mid + '\']').fadeOut(function() { - this.remove(); - }); - } - return true; } else { -- cgit v1.2.3