forked from jasder/taskover
fixed array logical bug
This commit is contained in:
parent
a8642d3169
commit
663afdaead
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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('任务更新成功 !')
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue