Skip to content

Commit

Permalink
chore(docs): fix back-to-top anchor in angularjs.org doc pages
Browse files Browse the repository at this point in the history
  • Loading branch information
petebacondarwin committed Nov 28, 2013
1 parent 753687e commit 1a8d3c8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/src/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ <h2>Would you like full offline support for this AngularJS Docs App?</h2>

<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
Expand Down
15 changes: 15 additions & 0 deletions docs/src/templates/js/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};

Expand Down

0 comments on commit 1a8d3c8

Please sign in to comment.