diff --git a/app/modules/navigation-bar/navigation-bar.directive.coffee b/app/modules/navigation-bar/navigation-bar.directive.coffee index bce9ea39..47b0da51 100644 --- a/app/modules/navigation-bar/navigation-bar.directive.coffee +++ b/app/modules/navigation-bar/navigation-bar.directive.coffee @@ -32,11 +32,6 @@ NavigationBarDirective = (currentUserService, navigationBarService, locationServ locationService.url(navUrlsService.resolve("login")) locationService.search({next: nextUrl}) - scope.vm.register = -> - nextUrl = encodeURIComponent(locationService.url()) - locationService.url(navUrlsService.resolve("register")) - locationService.search({next: nextUrl}) - scope.$on "$routeChangeSuccess", () -> if locationService.path() == "/" scope.vm.active = true diff --git a/app/modules/navigation-bar/navigation-bar.directive.spec.coffee b/app/modules/navigation-bar/navigation-bar.directive.spec.coffee index 1e746290..d8742bfe 100644 --- a/app/modules/navigation-bar/navigation-bar.directive.spec.coffee +++ b/app/modules/navigation-bar/navigation-bar.directive.spec.coffee @@ -130,19 +130,3 @@ describe "navigationBarDirective", () -> expect(mocks.locationService.url.calledWith("/login")).to.be.true expect(mocks.locationService.search.calledWith({next: encodeURIComponent(nextUrl)})).to.be.true expect(vm.publicRegisterEnabled).to.be.true - - it "navigation bar register", () -> - mocks.navUrls.resolve.withArgs("register").returns("/register") - nextUrl = "/discover/search?order_by=-total_activity_last_month" - mocks.locationService.url.returns(nextUrl) - elm = createDirective() - scope.$apply() - vm = elm.isolateScope().vm - expect(mocks.locationService.url.callCount).to.be.equal(0) - expect(mocks.locationService.search.callCount).to.be.equal(0) - vm.register() - expect(mocks.locationService.url.callCount).to.be.equal(2) - expect(mocks.locationService.search.callCount).to.be.equal(1) - expect(mocks.locationService.url.calledWith("/register")).to.be.true - expect(mocks.locationService.search.calledWith({next: encodeURIComponent(nextUrl)})).to.be.true - expect(vm.publicRegisterEnabled).to.be.true diff --git a/app/modules/navigation-bar/navigation-bar.jade b/app/modules/navigation-bar/navigation-bar.jade index 22d1e2da..3ba56d0f 100644 --- a/app/modules/navigation-bar/navigation-bar.jade +++ b/app/modules/navigation-bar/navigation-bar.jade @@ -30,9 +30,9 @@ nav.navbar(ng-if="vm.isEnabledHeader") translate="LOGIN_COMMON.ACTION_SIGN_IN" ) a.register( - ng-click="vm.register()" + href="#" ng-if="vm.publicRegisterEnabled" - href="#", + tg-nav="register" title="{{ 'REGISTER_FORM.ACTION_SIGN_UP' | translate }}" translate="REGISTER_FORM.ACTION_SIGN_UP" )