diff --git a/platform/commonUI/browse/src/navigation/NavigateAction.js b/platform/commonUI/browse/src/navigation/NavigateAction.js index efdfb270f4..431ad8dadc 100644 --- a/platform/commonUI/browse/src/navigation/NavigateAction.js +++ b/platform/commonUI/browse/src/navigation/NavigateAction.js @@ -49,9 +49,7 @@ define( NavigateAction.prototype.perform = function () { var self = this, navigateTo = this.domainObject, - currentObject = self.navigationService.getNavigation(), - editing = currentObject.hasCapability('editor') && - currentObject.getCapability('editor').isEditContextRoot(); + currentObject = self.navigationService.getNavigation(); function allow() { var navigationAllowed = true; @@ -63,6 +61,9 @@ define( } function cancelIfEditing() { + var editing = currentObject.hasCapability('editor') && + currentObject.getCapability('editor').isEditContextRoot(); + return self.$q.when(editing && currentObject.getCapability("editor").cancel()); } diff --git a/platform/commonUI/browse/test/navigation/NavigateActionSpec.js b/platform/commonUI/browse/test/navigation/NavigateActionSpec.js index b769d7dce1..509e7aef3d 100644 --- a/platform/commonUI/browse/test/navigation/NavigateActionSpec.js +++ b/platform/commonUI/browse/test/navigation/NavigateActionSpec.js @@ -140,7 +140,7 @@ define( }); }); - describe("in edit more", function () { + describe("in edit mode", function () { beforeEach(function () { mockNavigatedObject.hasCapability.andCallFake(function (capability) { return capability === "editor"; diff --git a/platform/commonUI/edit/src/actions/EditAction.js b/platform/commonUI/edit/src/actions/EditAction.js index 9c1afd3e28..e65f035edf 100644 --- a/platform/commonUI/edit/src/actions/EditAction.js +++ b/platform/commonUI/edit/src/actions/EditAction.js @@ -76,7 +76,6 @@ define( this.navigationService.setNavigation(this.domainObject); } - //this.navigationService.addListener(cancelEditing); this.domainObject.useCapability("editor"); };