From 27b7fa3914d5375721d2e575297f0b0c35770c3f Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Sun, 2 Mar 2014 15:37:09 +0000 Subject: docs(directives): ensure that the back-to-top directive resets location Closes #6512 Closes #6499 --- docs/app/src/directives.js | 3 ++- docs/config/templates/indexPage.template.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/app/src/directives.js b/docs/app/src/directives.js index 15bef69b..99a751c0 100644 --- a/docs/app/src/directives.js +++ b/docs/app/src/directives.js @@ -10,9 +10,10 @@ angular.module('directives', []) * * @description Ensure that the browser scrolls when the anchor is clicked */ -.directive('backToTop', ['$anchorScroll', function($anchorScroll) { +.directive('backToTop', ['$anchorScroll', '$location', function($anchorScroll, $location) { return function link(scope, element) { element.on('click', function(event) { + $location.hash(''); scope.$apply($anchorScroll); }); }; diff --git a/docs/config/templates/indexPage.template.html b/docs/config/templates/indexPage.template.html index 28128ba0..9582c825 100644 --- a/docs/config/templates/indexPage.template.html +++ b/docs/config/templates/indexPage.template.html @@ -226,7 +226,7 @@