diff --git a/platform/commonUI/browse/res/templates/browse-object.html b/platform/commonUI/browse/res/templates/browse-object.html index dee64c1153..22712d3dac 100644 --- a/platform/commonUI/browse/res/templates/browse-object.html +++ b/platform/commonUI/browse/res/templates/browse-object.html @@ -22,8 +22,7 @@
- + + - + diff --git a/platform/commonUI/edit/bundle.json b/platform/commonUI/edit/bundle.json index c216a9d877..d577013ffd 100644 --- a/platform/commonUI/edit/bundle.json +++ b/platform/commonUI/edit/bundle.json @@ -67,7 +67,7 @@ "implementation": "actions/SaveAction.js", "name": "Save", "description": "Save changes made to these objects.", - "depends": [ "$location", "urlService" ], + "depends": [ "$location", "urlService", "navigationService" ], "priority": "mandatory" }, { @@ -76,7 +76,7 @@ "implementation": "actions/CancelAction.js", "name": "Cancel", "description": "Discard changes made to these objects.", - "depends": [ "$location", "urlService" ] + "depends": [ "$location", "urlService", "navigationService" ] } ], "policies": [ diff --git a/platform/commonUI/edit/src/actions/CancelAction.js b/platform/commonUI/edit/src/actions/CancelAction.js index a9e6effe9f..b1585f0bfc 100644 --- a/platform/commonUI/edit/src/actions/CancelAction.js +++ b/platform/commonUI/edit/src/actions/CancelAction.js @@ -33,10 +33,11 @@ define( * @memberof platform/commonUI/edit * @implements {Action} */ - function CancelAction($location, urlService, context) { + function CancelAction($location, urlService, navigationService, context) { this.domainObject = context.domainObject; this.$location = $location; this.urlService = urlService; + this.navigationService = navigationService; } /** @@ -48,7 +49,8 @@ define( CancelAction.prototype.perform = function () { var domainObject = this.domainObject, $location = this.$location, - urlService = this.urlService; + urlService = this.urlService, + self = this; // Look up the object's "editor.completion" capability; // this is introduced by EditableDomainObject which is @@ -67,10 +69,11 @@ define( // Discard the current root view (which will be the editing // UI, which will have been pushed atop the Browise UI.) function returnToBrowse() { - $location.path($location.path(urlService.urlForLocation( + return self.navigationService.setNavigation(self.domainObject.getDomainObject()); + /*$location.path($location.path(urlService.urlForLocation( "browse", domainObject - ))); + )));*/ } return doCancel(getEditorCapability()) diff --git a/platform/commonUI/edit/src/actions/SaveAction.js b/platform/commonUI/edit/src/actions/SaveAction.js index fa276bba4b..2f7044660e 100644 --- a/platform/commonUI/edit/src/actions/SaveAction.js +++ b/platform/commonUI/edit/src/actions/SaveAction.js @@ -34,10 +34,11 @@ define( * @implements {Action} * @memberof platform/commonUI/edit */ - function SaveAction($location, urlService, context) { + function SaveAction($location, urlService, navigationService, context) { this.domainObject = (context || {}).domainObject; this.$location = $location; this.urlService = urlService; + this.navigationService = navigationService; } /** @@ -50,7 +51,8 @@ define( SaveAction.prototype.perform = function () { var domainObject = this.domainObject, $location = this.$location, - urlService = this.urlService; + urlService = this.urlService, + self = this; // Invoke any save behavior introduced by the editor capability; // this is introduced by EditableDomainObject which is @@ -61,12 +63,14 @@ define( } // Discard the current root view (which will be the editing - // UI, which will have been pushed atop the Browise UI.) + // UI, which will have been pushed atop the Browse UI.) function returnToBrowse() { - return $location.path(urlService.urlForLocation( + + return self.navigationService.setNavigation(self.domainObject.getDomainObject()); + /*return $location.path(urlService.urlForLocation( "browse", domainObject - )); + ));*/ } return doSave().then(returnToBrowse); diff --git a/platform/representation/src/gestures/DropGesture.js b/platform/representation/src/gestures/DropGesture.js index fc9a55858e..f1f59bc277 100644 --- a/platform/representation/src/gestures/DropGesture.js +++ b/platform/representation/src/gestures/DropGesture.js @@ -42,8 +42,8 @@ define( * composition should be modified as a result of the drop. */ function DropGesture(dndService, $q, navigationService, element, domainObject) { - var editableDomainObject = domainObject instanceof EditableDomainObject ? domainObject : new EditableDomainObject(domainObject, $q), - actionCapability = editableDomainObject.getCapability('action'), + var actionCapability = domainObject.getCapability('action'), + editableDomainObject, action; // Action for the drop, when it occurs function broadcastDrop(id, event) { @@ -70,6 +70,11 @@ define( } function dragOver(e) { + //Refresh domain object on each dragOver to catch external + // updates to the model + editableDomainObject = domainObject instanceof EditableDomainObject ? domainObject : new EditableDomainObject(domainObject, $q); + actionCapability = editableDomainObject.getCapability('action'); + var event = (e || {}).originalEvent || e, selectedObject = dndService.getData( GestureConstants.MCT_EXTENDED_DRAG_TYPE