Merge pull request #1023 from Sioxas/bugfix/modify-action-source
Fix #1022
This commit is contained in:
commit
c16ab58806
@ -244,13 +244,18 @@ function ManageWidgetActionsController($rootScope, $scope, $document, $mdDialog,
|
|||||||
vm.widgetActions[actionSourceId] = targetActions;
|
vm.widgetActions[actionSourceId] = targetActions;
|
||||||
}
|
}
|
||||||
if (prevActionId) {
|
if (prevActionId) {
|
||||||
var index = getActionIndex(prevActionId, vm.allActions);
|
const indexInTarget = getActionIndex(prevActionId, targetActions);
|
||||||
if (index > -1) {
|
const indexInAllActions = getActionIndex(prevActionId, vm.allActions);
|
||||||
vm.allActions[index] = action;
|
if (indexInTarget > -1) {
|
||||||
|
targetActions[indexInTarget] = widgetAction;
|
||||||
|
} else if (indexInAllActions > -1) {
|
||||||
|
const prevActionSourceId = vm.allActions[indexInAllActions].actionSourceId;
|
||||||
|
const index = getActionIndex(prevActionId,vm.widgetActions[prevActionSourceId]);
|
||||||
|
vm.widgetActions[prevActionSourceId].splice(index,1);
|
||||||
|
targetActions.push(widgetAction);
|
||||||
}
|
}
|
||||||
index = getActionIndex(prevActionId, targetActions);
|
if (indexInAllActions > -1) {
|
||||||
if (index > -1) {
|
vm.allActions[indexInAllActions] = action;
|
||||||
targetActions[index] = widgetAction;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
vm.allActions.push(action);
|
vm.allActions.push(action);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user