Editor bugfix missed cleanup before importing. Bugfix drag&drop at last position without doubleclick/drop-box

main 1.8.6
isark 1 year ago
parent 84695203ea
commit 3bbb50123a

@ -8,7 +8,7 @@
}, },
"package": { "package": {
"productName": "Nothing", "productName": "Nothing",
"version": "1.8.5" "version": "1.8.6"
}, },
"tauri": { "tauri": {
"systemTray": { "systemTray": {

@ -135,7 +135,7 @@ export class EditorComponent implements OnInit {
} }
const bounds = this.planElemFilterBounds(); const bounds = this.planElemFilterBounds();
let index = event.item.data; let index = event.currentIndex;
if (bounds) { if (bounds) {
index += bounds[0]; index += bounds[0];
} }
@ -318,6 +318,9 @@ export class EditorComponent implements OnInit {
if (file) { if (file) {
// We disallow multiple but interface still says it can be multiple, thus the cast. // We disallow multiple but interface still says it can be multiple, thus the cast.
this.planService.loadPlanFromPath(file as string, false).subscribe(plan => { this.planService.loadPlanFromPath(file as string, false).subscribe(plan => {
while (this.original.length > 0) {
this.original.pop();
}
plan.plan.forEach(item => this.original.push(item)); plan.plan.forEach(item => this.original.push(item));
this.filterPlanElements(); this.filterPlanElements();
}); });
@ -327,6 +330,9 @@ export class EditorComponent implements OnInit {
loadBasePlan() { loadBasePlan() {
this.planService.getBasePlan().subscribe(plan => { this.planService.getBasePlan().subscribe(plan => {
while (this.original.length > 0) {
this.original.pop();
}
plan.plan.forEach(item => this.original.push(item)); plan.plan.forEach(item => this.original.push(item));
this.filterPlanElements(); this.filterPlanElements();
}) })

Loading…
Cancel
Save