diff --git a/app/assets/stylesheets/plans.scss b/app/assets/stylesheets/plans.scss index e9cf3b2..ab5fcf8 100644 --- a/app/assets/stylesheets/plans.scss +++ b/app/assets/stylesheets/plans.scss @@ -255,7 +255,7 @@ left: 0; width: 100%; height: 1px; - background: #888888; + background: #777777; animation-name: closed-task; animation-duration: 0.3s; animation-timing-function: linear; diff --git a/app/views/plans/show.html.haml b/app/views/plans/show.html.haml index 3d9696a..a663bc8 100644 --- a/app/views/plans/show.html.haml +++ b/app/views/plans/show.html.haml @@ -213,11 +213,18 @@ if (result.status == 'failed') { notifyTop(result.message, 'danger') } else { + var closePos = 0 + var taskPos = 0 for (var i = 0; i < list.tasks.length; i++){ - if ( list.tasks[i].path == path ){ - list.tasks.splice(i, 1, result) + if ( list.tasks[i].status == 1 ){ + closePos += 1 + } + if (list.tasks[i].path == path) { + taskPos = i } } + list.tasks.splice(taskPos, 1) + list.tasks.splice(closePos - 1, 0, result) notifyTop('任务更新成功 !') } }