From c92e6ed929ddb12a3020eecf419a30b680fe4240 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 16 Jun 2011 00:38:41 -0700 Subject: [PATCH] avoid race condition on delete checked items --- mod/item.php | 2 ++ view/jot-header.tpl | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mod/item.php b/mod/item.php index 3edbae696e..98f4ff90c2 100644 --- a/mod/item.php +++ b/mod/item.php @@ -26,6 +26,8 @@ function item_post(&$a) { require_once('include/items.php'); $arr_drop = explode(',',$_POST['dropitems']); drop_items($arr_drop); + $json = array('success' => 1); + echo json_encode($json); killme(); } diff --git a/view/jot-header.tpl b/view/jot-header.tpl index 382a526446..61c80702ef 100644 --- a/view/jot-header.tpl +++ b/view/jot-header.tpl @@ -120,9 +120,9 @@ tinyMCE.init({ checkedstr = $(this).val(); } }); - $.post('item', { dropitems: checkedstr }); - window.location.reload(); - + $.post('item', { dropitems: checkedstr }, function(data) { + window.location.reload(); + }); } function jotGetLink() {