travis-web/app/mixins/scroll-reset.js
Piotr Sarnacki 55005b1b13 Scroll page in beforeModel hook in scroll-mixin
The `activate` hook is not always called when the route is used,
specifically it will not be called when the model changes, but the
change happened within the same route (for example when switching from
/travis-ci/travis-web to /travis-ci/travis-core). `beforeModel` is
guaranteed to be called every time the model is changed, both when the
route is entered for the first time and on any subsequent calls.
2016-02-23 13:05:36 +01:00

9 lines
157 B
JavaScript

import Ember from 'ember';
export default Ember.Mixin.create({
beforeModel: function() {
this._super(...arguments);
window.scrollTo(0,0);
}
});