mirror of
https://github.com/nasa/openmct.git
synced 2025-04-20 00:51:09 +00:00
[Edit] Bind action to .perform() inside mct-button
This commit is contained in:
parent
4b51e604a7
commit
a34e89d56a
@ -25,7 +25,7 @@
|
||||
<mct-control key="'button'"
|
||||
structure="{
|
||||
text: saveActions[0].getMetadata().name,
|
||||
click: saveActions[0].perform,
|
||||
click: actionPerformer(saveActions[0]),
|
||||
cssclass: 'major ' + saveActions[0].getMetadata().cssclass
|
||||
}">
|
||||
</mct-control>
|
||||
@ -45,7 +45,7 @@
|
||||
<mct-control key="'button'"
|
||||
structure="{
|
||||
text: currentAction.getMetadata().name,
|
||||
click: currentAction.perform,
|
||||
click: actionPerformer(currentAction),
|
||||
cssclass: currentAction.getMetadata().cssclass
|
||||
}">
|
||||
</mct-control>
|
||||
|
@ -61,6 +61,12 @@ define(
|
||||
$scope.otherEditActions = $scope.action ?
|
||||
$scope.action.getActions(OTHERS_ACTION_CONTEXT) :
|
||||
[];
|
||||
|
||||
// Required because Angular does not allow 'bind'
|
||||
// in expressions.
|
||||
$scope.actionPerformer = function (action) {
|
||||
return action.perform.bind(action);
|
||||
};
|
||||
}
|
||||
|
||||
// Update set of actions whenever the action capability
|
||||
|
Loading…
x
Reference in New Issue
Block a user