Resetting scrool router


Hi when i change the page there is many case that my page is not at the top so I see on the ember guide

but where i put the code

App.ResetScroll = Ember.Mixin.create({
  activate: function() {

in my ember application?


Yeah, that can be a tricky thing. Perhaps look at the ember-router-scroll addon.


It seems like you’re not in cli yet, and you’re also using ember 1.10… there must be a reason for that, which doesn’t matter right now…

The mixin you have should be enough already tho.

Just make sure you pass it to your routes:

App.SomeRoute = Ember.Route.extend(App.ResetScroll, {

 // your route implementation here