Commit 9c3324de authored by Romain DELEAU's avatar Romain DELEAU

remove cutting line when moving a task

parent bcdad39a
...@@ -64,7 +64,7 @@ export class Role { ...@@ -64,7 +64,7 @@ export class Role {
} else if (direction == 'top') { } else if (direction == 'top') {
if (!(this.tasks[i-1].some(element => element instanceof Task))) { if (!(this.tasks[i-1].some(element => element instanceof Task))) {
this.tasks[i-1][j] = tmp; this.tasks[i-1][j] = tmp;
this.tasks[i].splice(j, 1); this.tasks[i][j] = null;
} else if (this.tasks[i-1].some(element => element?.type == 'final' || element?.type == 'repeat')) { } else if (this.tasks[i-1].some(element => element?.type == 'final' || element?.type == 'repeat')) {
if (this.tasks[i][j]?.type == 'final' || this.tasks[i][j]?.type == 'repeat') { if (this.tasks[i][j]?.type == 'final' || this.tasks[i][j]?.type == 'repeat') {
this.tasks[i][j] = this.tasks[i-1][this.getLastTaskIndex(i-1)]; this.tasks[i][j] = this.tasks[i-1][this.getLastTaskIndex(i-1)];
...@@ -73,11 +73,12 @@ export class Role { ...@@ -73,11 +73,12 @@ export class Role {
let deplace = this.tasks[i-1][this.getLastTaskIndex(i-1)]; let deplace = this.tasks[i-1][this.getLastTaskIndex(i-1)];
this.tasks[i-1][this.getLastTaskIndex(i-1)] = tmp; this.tasks[i-1][this.getLastTaskIndex(i-1)] = tmp;
this.tasks[i-1][this.getLastTaskIndex(i-1)+1] = deplace; this.tasks[i-1][this.getLastTaskIndex(i-1)+1] = deplace;
this.tasks[i].splice(j, 1); this.tasks[i][j] = null;
} }
} else { } else {
this.tasks[i-1][this.getLastTaskIndex(i-1)+1] = tmp; this.tasks[i-1][this.getLastTaskIndex(i-1)+1] = tmp;
this.tasks[i].splice(j, 1); this.tasks[i][j] = null;
} }
if (!this.tasks[i].some(element => element instanceof Task)) { if (!this.tasks[i].some(element => element instanceof Task)) {
this.tasks.splice(i,1); this.tasks.splice(i,1);
...@@ -88,7 +89,7 @@ export class Role { ...@@ -88,7 +89,7 @@ export class Role {
} }
if (!(this.tasks[i+1].some(element => element instanceof Task))) { if (!(this.tasks[i+1].some(element => element instanceof Task))) {
this.tasks[i+1][j] = tmp; this.tasks[i+1][j] = tmp;
this.tasks[i].splice(j, 1); this.tasks[i][j] = null;
} else if (this.tasks[i+1].some(element => element?.type == 'final' || element?.type == 'repeat')) { } else if (this.tasks[i+1].some(element => element?.type == 'final' || element?.type == 'repeat')) {
if (this.tasks[i][j]?.type == 'final' || this.tasks[i][j]?.type == 'repeat') { if (this.tasks[i][j]?.type == 'final' || this.tasks[i][j]?.type == 'repeat') {
this.tasks[i][j] = this.tasks[i+1][this.getLastTaskIndex(i+1)]; this.tasks[i][j] = this.tasks[i+1][this.getLastTaskIndex(i+1)];
...@@ -97,11 +98,11 @@ export class Role { ...@@ -97,11 +98,11 @@ export class Role {
let deplace = this.tasks[i+1][this.getLastTaskIndex(i+1)]; let deplace = this.tasks[i+1][this.getLastTaskIndex(i+1)];
this.tasks[i+1][this.getLastTaskIndex(i+1)] = tmp; this.tasks[i+1][this.getLastTaskIndex(i+1)] = tmp;
this.tasks[i+1][this.getLastTaskIndex(i+1)+1] = deplace; this.tasks[i+1][this.getLastTaskIndex(i+1)+1] = deplace;
this.tasks[i].splice(j, 1); this.tasks[i][j] = null;
} }
} else { } else {
this.tasks[i+1][this.getLastTaskIndex(i+1)+1] = tmp; this.tasks[i+1][this.getLastTaskIndex(i+1)+1] = tmp;
this.tasks[i].splice(j, 1); this.tasks[i][j] = null;
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment