From 9c564d5e38795c6622d2d07b177aeb300c8891a2 Mon Sep 17 00:00:00 2001 From: Max Pozdeev Date: Sun, 20 Sep 2009 19:54:58 +0400 Subject: [PATCH] - bugfix: task count not updated while search when duedate filter set --- src/ajax.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ajax.js b/src/ajax.js index 87315bb..aebbef8 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -31,7 +31,6 @@ function loadTasks() nocache = '&rnd='+Math.random(); $.getJSON('ajax.php?loadTasks&compl='+filter.compl+'&sort='+sortBy+search+tag+'&tz='+tz+nocache, function(json){ resetAjaxErrorTrigger(); - $('#total').html(json.total); taskList = new Array(); taskOrder = new Array(); taskCnt.past = taskCnt.today = taskCnt.soon = 0; @@ -44,6 +43,10 @@ function loadTasks() if(!item.compl) changeTaskCnt(item.dueClass); }); refreshTaskCnt(); + if(filter.due == '') $('#total').html(taskCnt.total); + else if(filter.due == 'past') $('#total').html(taskCnt.past); + else if(filter.due == 'today') $('#total').html(taskCnt.today); + else if(filter.due == 'soon') $('#total').html(taskCnt.soon); $('#tasklist').html(tasks); if(filter.compl) showhide($('#compl_hide'),$('#compl_show')); else showhide($('#compl_show'),$('#compl_hide'));