Skip to content

Commit

Permalink
scroll to top after state change success
Browse files Browse the repository at this point in the history
  • Loading branch information
lufeng committed Apr 7, 2015
1 parent ca95265 commit c3da215
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .docs/angular-meteor/client/scripts/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,11 @@ angular.module("meteor-angular-docs").config(['$urlRouterProvider', '$stateProvi
});

$locationProvider.html5Mode(true);
}]);
}])

.run(function($rootScope) {
$rootScope.$on('$stateChangeSuccess', function() {
// window.scrollTo(0, 0);
document.body.scrollTop = 0;
})
})

0 comments on commit c3da215

Please sign in to comment.