mirror of
https://github.com/nasa/openmct.git
synced 2025-05-09 12:03:21 +00:00
Complete in-line documentation for bundle platform/commonUI/edit (Edit Mode), one of the common user interface bundles being transitioned for WTD-574.
34 lines
1.1 KiB
JavaScript
34 lines
1.1 KiB
JavaScript
/*global define,Promise*/
|
|
|
|
/**
|
|
* Module defining EditController. Created by vwoeltje on 11/14/14.
|
|
*/
|
|
define(
|
|
["./objects/EditableDomainObject"],
|
|
function (EditableDomainObject) {
|
|
"use strict";
|
|
|
|
/**
|
|
* Controller which is responsible for populating the scope for
|
|
* Edit mode; introduces an editable version of the currently
|
|
* navigated domain object into the scope.
|
|
* @constructor
|
|
*/
|
|
function EditController($scope, navigationService) {
|
|
function setNavigation(domainObject) {
|
|
// Wrap the domain object such that all mutation is
|
|
// confined to edit mode (until Save)
|
|
$scope.navigatedObject =
|
|
domainObject && new EditableDomainObject(domainObject);
|
|
}
|
|
|
|
setNavigation(navigationService.getNavigation());
|
|
navigationService.addListener(setNavigation);
|
|
$scope.$on("$destroy", function () {
|
|
navigationService.removeListener(setNavigation);
|
|
});
|
|
}
|
|
|
|
return EditController;
|
|
}
|
|
); |