From 7a94efccbf2a35ef60f9fbf1f23acfc0287cfe46 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 22 Sep 2016 11:04:04 -0700 Subject: [PATCH] [Edit Mode] Fixed spelling mistake, moved variable declaration --- platform/commonUI/browse/src/navigation/NavigateAction.js | 7 ++++--- .../commonUI/browse/test/navigation/NavigateActionSpec.js | 2 +- platform/commonUI/edit/src/actions/EditAction.js | 1 - 3 files changed, 5 insertions(+), 5 deletions(-) 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"); };