mirror of
https://github.com/nasa/openmct.git
synced 2025-06-13 12:48:14 +00:00
[Common UI] Add skeleton specs for edit mode
Add empty files which will contain specs for bundle platform/commonUI/edit, which is responsible for Edit mode. WTD-574.
This commit is contained in:
@ -8,21 +8,23 @@ define(
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
var ACTION_CONTEXT = { category: 'conclude-editing' };
|
||||
|
||||
/**
|
||||
* Controller which supplies action instances for Save/Cancel.
|
||||
* @constructor
|
||||
*/
|
||||
function EditActionController($scope) {
|
||||
// Maintain all "conclude-editing" actions in the present
|
||||
// context.
|
||||
function updateActions() {
|
||||
if (!$scope.action) {
|
||||
$scope.editActions = [];
|
||||
} else {
|
||||
$scope.editActions = $scope.action.getActions({
|
||||
category: 'conclude-editing'
|
||||
});
|
||||
}
|
||||
$scope.editActions = $scope.action ?
|
||||
$scope.action.getActions(ACTION_CONTEXT) :
|
||||
[];
|
||||
}
|
||||
|
||||
// Update set of actions whenever the action capability
|
||||
// changes or becomes available.
|
||||
$scope.$watch("action", updateActions);
|
||||
}
|
||||
|
||||
|
@ -79,10 +79,6 @@ define(
|
||||
// Save All. An infinite loop is avoided by marking
|
||||
// objects as clean as we go.
|
||||
|
||||
function doSave(editCapability) {
|
||||
return editCapability.save();
|
||||
}
|
||||
|
||||
while (Object.keys(dirty).length > 0) {
|
||||
// Pick the first dirty object
|
||||
object = dirty[Object.keys(dirty)[0]];
|
||||
@ -91,7 +87,7 @@ define(
|
||||
this.markClean(object);
|
||||
|
||||
// Invoke its save behavior
|
||||
object.getCapability('editor.completion').then(doSave);
|
||||
object.getCapability('editor').save();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user