aboutsummaryrefslogtreecommitdiffstats
path: root/docs/src
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
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')
-rw-r--r--docs/src/templates/index.html2
-rw-r--r--docs/src/templates/js/docs.js15
2 files changed, 16 insertions, 1 deletions
diff --git a/docs/src/templates/index.html b/docs/src/templates/index.html
index 43c9e858..3d64a4f5 100644
--- a/docs/src/templates/index.html
+++ b/docs/src/templates/index.html
@@ -364,7 +364,7 @@
<footer class="footer">
<div class="container">
- <p class="pull-right"><a href="#">Back to top</a></p>
+ <p class="pull-right"><a back-to-top href="#">Back to top</a></p>
<p>
Super-powered by Google ©2010-2012
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 = {};