aboutsummaryrefslogtreecommitdiffstats
path: root/docs/src/templates/js/docs.js
diff options
context:
space:
mode:
authorPeter Bacon Darwin2013-11-28 12:11:57 +0000
committerPeter Bacon Darwin2013-11-28 12:16:07 +0000
commit1a8d3c8b3a0d662fb3b8f2765102e50f7cd1c0a4 (patch)
tree6cca1a96094399bd4efd7f5bb6a815754d040bc1 /docs/src/templates/js/docs.js
parent753687e5c2d601823e08791288ab65ee6b86770d (diff)
downloadangular.js-1a8d3c8b3a0d662fb3b8f2765102e50f7cd1c0a4.tar.bz2
chore(docs): fix back-to-top anchor in angularjs.org doc pages
Closes https://github.com/angular/angularjs.org/issues/45
Diffstat (limited to 'docs/src/templates/js/docs.js')
-rw-r--r--docs/src/templates/js/docs.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/src/templates/js/docs.js b/docs/src/templates/js/docs.js
index 06cb91c2..6231c59d 100644
--- a/docs/src/templates/js/docs.js
+++ b/docs/src/templates/js/docs.js
@@ -372,6 +372,21 @@ docsApp.directive.errorDisplay = ['$location', 'errorLinkFilter', function ($loc
}];
+/**
+ * backToTop Directive
+ * @param {Function} $anchorScroll
+ *
+ * @description Ensure that the browser scrolls when the anchor is clicked
+ */
+docsApp.directive.backToTop = ['$anchorScroll', function($anchorScroll) {
+ return function link(scope, element) {
+ element.on('click', function(event) {
+ scope.$apply($anchorScroll);
+ });
+ };
+}];
+
+
docsApp.serviceFactory.angularUrls = function($document) {
var urls = {};