Virtual panels working again with refactored code
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
{
|
||||
"key": "edit",
|
||||
"implementation": "actions/EditAction.js",
|
||||
"depends": [ "$location", "navigationService", "$log" ],
|
||||
"depends": [ "$location", "navigationService", "$log", "$q" ],
|
||||
"description": "Edit this object.",
|
||||
"category": "view-control",
|
||||
"glyph": "p"
|
||||
@@ -78,7 +78,7 @@
|
||||
"implementation": "actions/CancelAction.js",
|
||||
"name": "Cancel",
|
||||
"description": "Discard changes made to these objects.",
|
||||
"depends": [ "$location", "urlService", "navigationService" ]
|
||||
"depends": ["$injector", "navigationService"]
|
||||
}
|
||||
],
|
||||
"policies": [
|
||||
|
||||
@@ -33,11 +33,10 @@ define(
|
||||
* @memberof platform/commonUI/edit
|
||||
* @implements {Action}
|
||||
*/
|
||||
function CancelAction($location, urlService, navigationService, context) {
|
||||
function CancelAction($injector, navigationService, context) {
|
||||
this.domainObject = context.domainObject;
|
||||
this.$location = $location;
|
||||
this.urlService = urlService;
|
||||
this.navigationService = navigationService;
|
||||
this.objectService = $injector.get('objectService');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,8 +47,6 @@ define(
|
||||
*/
|
||||
CancelAction.prototype.perform = function () {
|
||||
var domainObject = this.domainObject,
|
||||
$location = this.$location,
|
||||
urlService = this.urlService,
|
||||
self = this;
|
||||
|
||||
// Look up the object's "editor.completion" capability;
|
||||
@@ -69,11 +66,11 @@ define(
|
||||
// Discard the current root view (which will be the editing
|
||||
// UI, which will have been pushed atop the Browise UI.)
|
||||
function returnToBrowse() {
|
||||
return self.navigationService.setNavigation(self.domainObject.getDomainObject());
|
||||
/*$location.path($location.path(urlService.urlForLocation(
|
||||
"browse",
|
||||
domainObject
|
||||
)));*/
|
||||
self.objectService.getObjects([self.domainObject.getId()]).then(function(objects){
|
||||
return self.navigationService.setNavigation(objects[self.domainObject.getId()]);
|
||||
})
|
||||
//return
|
||||
// self.navigationService.setNavigation(self.domainObject.getDomainObject());
|
||||
}
|
||||
|
||||
return doCancel(getEditorCapability())
|
||||
|
||||
@@ -46,7 +46,7 @@ define(
|
||||
* @constructor
|
||||
* @implements {Action}
|
||||
*/
|
||||
function EditAction($location, navigationService, $log, context) {
|
||||
function EditAction($location, navigationService, $log, $q, context) {
|
||||
var domainObject = (context || {}).domainObject;
|
||||
|
||||
// We cannot enter Edit mode if we have no domain object to
|
||||
@@ -65,6 +65,7 @@ define(
|
||||
this.domainObject = domainObject;
|
||||
this.$location = $location;
|
||||
this.navigationService = navigationService;
|
||||
this.$q = $q;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -72,7 +73,7 @@ define(
|
||||
*/
|
||||
EditAction.prototype.perform = function () {
|
||||
if (!this.domainObject.getDomainObject) {
|
||||
this.navigationService.setNavigation(new EditableDomainObject(this.domainObject));
|
||||
this.navigationService.setNavigation(new EditableDomainObject(this.domainObject, this.$q));
|
||||
}
|
||||
//this.$location.path("/edit");
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user