Merge pull request #4384 from kjac/v8-fix-actions-menu

V8: Fix the editor actions menu
This commit is contained in:
Niels Lyngsø
2019-02-04 08:37:10 +01:00
committed by GitHub

View File

@@ -18,6 +18,10 @@
//adds a handler to the context menu item click, we need to handle this differently
//depending on what the menu item is supposed to do.
scope.executeMenuItem = function (action) {
//the action is called as it would be by the tree. to ensure that the action targets the correct node,
//we need to set the current node in appState before calling the action. otherwise we break all actions
//that use the current node (and that's pretty much all of them)
appState.setMenuState("currentNode", scope.currentNode);
navigationService.executeMenuAction(action, scope.currentNode, scope.currentSection);
scope.dropdown.isOpen = false;
};
@@ -29,10 +33,6 @@
return;
}
//when the options item is selected, we need to set the current menu item in appState (since this is synonymous with a menu)
// Niels: No i think we are wrong, we should not set the currentNode, cause it represents the currentNode of interaction.
//appState.setMenuState("currentNode", scope.currentNode);
if (!scope.actions) {
treeService.getMenu({ treeNode: scope.currentNode })
.then(function (data) {