Virtual panels working again with refactored code

This commit is contained in:
Henry
2015-11-11 14:59:00 -08:00
parent 5f8d13672f
commit f0e293a513
6 changed files with 19 additions and 21 deletions

View File

@@ -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())