Skip to content

Commit

Permalink
Add scroll to top behavior on docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredhanson committed Aug 23, 2016
1 parent 458fb97 commit 83e6f6a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 0 additions & 5 deletions www/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ function($, hljs, Bloodhound, __$_typeahead, search, docs, page) {

search('.search-con');
docs();

$(document).on('click', '.go-top', function(ev) {
scrollToId('#top');
return false;
});

$(document).on('click', '.menu-trigger', function(ev) {
toggleResponsiveMenu();
Expand Down
9 changes: 9 additions & 0 deletions www/app/docs.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
define(['jquery', 'page'],
function($, page) {

return function() {
// docs nav (doesnt yet expand accoridon?)
$(window).on('scroll', function (ev) {
toggleFixedNavigation(ev);
toggleActiveSections(ev);
});

$(document).on('click', '.go-top', function(ev) {
console.log('scroll top');
scrollToId('#top');
return false;
});

page('/docs/:document', function (ctx, next) {
// FIXME: open search is undefined
if ('providers' === ctx.params.document) return openSearch.call(document);
Expand Down Expand Up @@ -70,4 +77,6 @@ function($, page) {
$(".search-con .info-line span").text('0');
}

}

});

0 comments on commit 83e6f6a

Please sign in to comment.