mirror of
https://github.com/nasa/openmct.git
synced 2025-01-04 12:24:10 +00:00
Fixed buttons not appearing on edit mode click
This commit is contained in:
parent
5a2f073975
commit
ba8c2b8468
@ -38,7 +38,7 @@
|
|||||||
{
|
{
|
||||||
"key": "edit",
|
"key": "edit",
|
||||||
"implementation": "actions/EditAction.js",
|
"implementation": "actions/EditAction.js",
|
||||||
"depends": [ "$location", "navigationService", "$log" ],
|
"depends": [ "$location", "navigationService", "$log", "now" ],
|
||||||
"description": "Edit this object.",
|
"description": "Edit this object.",
|
||||||
"category": "view-control",
|
"category": "view-control",
|
||||||
"glyph": "p"
|
"glyph": "p"
|
||||||
|
@ -46,7 +46,7 @@ define(
|
|||||||
* @constructor
|
* @constructor
|
||||||
* @implements {Action}
|
* @implements {Action}
|
||||||
*/
|
*/
|
||||||
function EditAction($location, navigationService, $log, context) {
|
function EditAction($location, navigationService, $log, now, context) {
|
||||||
var domainObject = (context || {}).domainObject;
|
var domainObject = (context || {}).domainObject;
|
||||||
|
|
||||||
// We cannot enter Edit mode if we have no domain object to
|
// We cannot enter Edit mode if we have no domain object to
|
||||||
@ -65,6 +65,7 @@ define(
|
|||||||
this.domainObject = domainObject;
|
this.domainObject = domainObject;
|
||||||
this.$location = $location;
|
this.$location = $location;
|
||||||
this.navigationService = navigationService;
|
this.navigationService = navigationService;
|
||||||
|
this.now = now;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -72,7 +73,11 @@ define(
|
|||||||
*/
|
*/
|
||||||
EditAction.prototype.perform = function () {
|
EditAction.prototype.perform = function () {
|
||||||
if (!this.domainObject.getDomainObject) {
|
if (!this.domainObject.getDomainObject) {
|
||||||
this.navigationService.setNavigation(new EditableDomainObject(this.domainObject));
|
//var editableModel =
|
||||||
|
// JSON.parse(JSON.stringify(this.domainObject.getModel()));
|
||||||
|
var editableModel = this.domainObject.getModel();
|
||||||
|
editableModel.modified = this.now();
|
||||||
|
this.navigationService.setNavigation(new EditableDomainObject(this.domainObject, editableModel));
|
||||||
}
|
}
|
||||||
//this.$location.path("/edit");
|
//this.$location.path("/edit");
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user