|
|
|
@ -244,13 +244,18 @@ function ManageWidgetActionsController($rootScope, $scope, $document, $mdDialog, |
|
|
|
vm.widgetActions[actionSourceId] = targetActions; |
|
|
|
} |
|
|
|
if (prevActionId) { |
|
|
|
var index = getActionIndex(prevActionId, vm.allActions); |
|
|
|
if (index > -1) { |
|
|
|
vm.allActions[index] = action; |
|
|
|
const indexInTarget = getActionIndex(prevActionId, targetActions); |
|
|
|
const indexInAllActions = getActionIndex(prevActionId, vm.allActions); |
|
|
|
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 (index > -1) { |
|
|
|
targetActions[index] = widgetAction; |
|
|
|
if (indexInAllActions > -1) { |
|
|
|
vm.allActions[indexInAllActions] = action; |
|
|
|
} |
|
|
|
} else { |
|
|
|
vm.allActions.push(action); |
|
|
|
|