UI: Fixed calculate action index in other page
This commit is contained in:
parent
896f07218b
commit
2f16c1a1fe
@ -172,8 +172,11 @@ export class ManageWidgetActionsComponent extends PageComponent implements OnIni
|
|||||||
first()
|
first()
|
||||||
).subscribe((actions) => {
|
).subscribe((actions) => {
|
||||||
const action = actions.data;
|
const action = actions.data;
|
||||||
const startActionSourceIndex = action.findIndex(element => element.actionSourceId === droppedAction.actionSourceId);
|
let startActionSourceIndex = action.findIndex(element => element.actionSourceId === droppedAction.actionSourceId);
|
||||||
const targetActions = this.getOrCreateTargetActions(droppedAction.actionSourceId);
|
const targetActions = this.getOrCreateTargetActions(droppedAction.actionSourceId);
|
||||||
|
if (startActionSourceIndex === 0) {
|
||||||
|
startActionSourceIndex -= targetActions.findIndex(element => element.id === action[0].id);
|
||||||
|
}
|
||||||
moveItemInArray(targetActions, event.previousIndex - startActionSourceIndex, event.currentIndex - startActionSourceIndex);
|
moveItemInArray(targetActions, event.previousIndex - startActionSourceIndex, event.currentIndex - startActionSourceIndex);
|
||||||
this.onActionsUpdated();
|
this.onActionsUpdated();
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user