mirror of
https://github.com/maxpozdeev/mytinytodo.git
synced 2026-03-11 08:55:27 +00:00
- bugfix: incorrect number of tasks shown after task completing, deleting or moving (in some cases)
This commit is contained in:
parent
53396fee80
commit
594bb28d63
1 changed files with 4 additions and 0 deletions
|
|
@ -184,6 +184,7 @@ function deleteTask(id)
|
|||
$.getJSON('ajax.php?deleteTask='+id+nocache, function(json){
|
||||
resetAjaxErrorTrigger();
|
||||
if(!parseInt(json.total)) return;
|
||||
taskCnt.total--;
|
||||
$('#total').text( parseInt($('#total').text()) - 1 );
|
||||
var item = json.list[0];
|
||||
taskOrder.splice($.inArray(id,taskOrder), 1);
|
||||
|
|
@ -212,6 +213,7 @@ function completeTask(id,ch)
|
|||
delete taskList[id];
|
||||
taskOrder.splice($.inArray(id,taskOrder), 1);
|
||||
$('#taskrow_'+item.id).fadeOut('normal', function(){ $(this).remove() });
|
||||
taskCnt.total--;
|
||||
$('#total').html( parseInt($('#total').text())-1 );
|
||||
}
|
||||
else if(filter.compl) {
|
||||
|
|
@ -1303,6 +1305,8 @@ function moveTaskToList(taskId, listId)
|
|||
$.post('ajax.php?moveTask&rnd='+Math.random(), { id:taskId, from:curList.id, to:listId }, function(json){
|
||||
resetAjaxErrorTrigger();
|
||||
if(!parseInt(json.total)) return;
|
||||
if(changeTaskCnt(taskList[taskId].dueClass, -1)) refreshTaskCnt();
|
||||
taskCnt.total--;
|
||||
delete taskList[taskId];
|
||||
taskOrder.splice($.inArray(taskId,taskOrder), 1);
|
||||
$('#taskrow_'+taskId).fadeOut('normal', function(){ $(this).remove() });
|
||||
|
|
|
|||
Loading…
Reference in a new issue