Skip to content
Snippets Groups Projects
Commit 9d5bb042 authored by Vinciane's avatar Vinciane
Browse files

FIX #9798 Drag and drop

parent 468e6ce3
No related branches found
No related tags found
No related merge requests found
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
</div> </div>
<div class="col-md-6 active-data"> <div class="col-md-6 active-data">
<h2><span class="title">{{lang.chosenDatas}}</span> <i class="fa fa-eraser removeAllDatas" color="warn" title="{{lang.removeAllDatas}}" (click)="removeAllData()"></i></h2> <h2><span class="title">{{lang.chosenDatas}}</span> <i class="fa fa-minus-circle removeAllDatas" color="warn" title="{{lang.removeAllDatas}}" (click)="removeAllData()"></i></h2>
<div cdkDropList #dataExportList="cdkDropList" [cdkDropListData]="exportModel.data" <div cdkDropList #dataExportList="cdkDropList" [cdkDropListData]="exportModel.data"
[cdkDropListConnectedTo]="[dataAvailableList]" class="cdk-list" (cdkDropListDropped)="drop($event)"> [cdkDropListConnectedTo]="[dataAvailableList]" class="cdk-list" (cdkDropListDropped)="drop($event)">
<div class="columns" *ngFor="let item of exportModel.data;let i = index" cdkDrag>{{item.label}} <i <div class="columns" *ngFor="let item of exportModel.data;let i = index" cdkDrag>{{item.label}} <i
......
...@@ -251,11 +251,9 @@ export class ListAdministrationComponent implements OnInit { ...@@ -251,11 +251,9 @@ export class ListAdministrationComponent implements OnInit {
if (event.previousContainer === event.container) { if (event.previousContainer === event.container) {
moveItemInArray(event.container.data, event.previousIndex, event.currentIndex); moveItemInArray(event.container.data, event.previousIndex, event.currentIndex);
} else { } else {
const fakeIndex = $j('.available-data .columns')[event.previousIndex].id;
const realIndex = this.dataAvailable.map((dataAv: any) => (dataAv.id)).indexOf(fakeIndex);
transferArrayItem(event.previousContainer.data, transferArrayItem(event.previousContainer.data,
event.container.data, event.container.data,
realIndex, event.previousIndex,
event.currentIndex); event.currentIndex);
this.listFilter.nativeElement.value = ''; this.listFilter.nativeElement.value = '';
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment