Skip to content
Snippets Groups Projects
Commit 781568b0 authored by rhenck's avatar rhenck
Browse files

Fix drag and drop with images

The dragged image did contain carry information about it's element.
Also remove useless drag and drop functionality for the placeholder.
parent 82f8b528
No related branches found
No related tags found
No related merge requests found
Pipeline #38473 passed
......@@ -87,7 +87,8 @@ import { DragNDropValueObject } from 'common/models/elements/element';
class="item"
[ngClass]="{ 'vertical-orientation' : elementModel.orientation === 'vertical',
'horizontal-orientation' : elementModel.orientation === 'horizontal'}"
cdkDrag (cdkDragStarted)=dragStart(index) (cdkDragEnded)="dragEnd()"
cdkDrag [cdkDragData]="{ element: dropListValueElement, index: index }"
(cdkDragStarted)=dragStart(index) (cdkDragEnded)="dragEnd()"
[style.object-fit]="'scale-down'">
<img *ngIf="elementModel.copyOnDrop && draggedItemIndex === index && dropListValueElement.imgSrcValue"
[src]="dropListValueElement.imgSrcValue | safeResourceUrl" alt="Image Placeholder"
......@@ -95,7 +96,6 @@ import { DragNDropValueObject } from 'common/models/elements/element';
class="item"
[ngClass]="{ 'vertical-orientation' : elementModel.orientation === 'vertical',
'horizontal-orientation' : elementModel.orientation === 'horizontal'}"
cdkDrag (cdkDragStarted)=dragStart(index) (cdkDragEnded)="dragEnd()"
[style.object-fit]="'scale-down'">
</ng-template>
</div>
......
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