2017-09-19 14:47:10 +00:00
|
|
|
import Ember from 'ember';
|
|
|
|
|
2017-10-23 17:21:44 +00:00
|
|
|
const { Route, inject } = Ember;
|
2017-09-19 14:47:10 +00:00
|
|
|
|
2017-09-26 23:37:08 +00:00
|
|
|
export default Route.extend({
|
2017-10-23 17:21:44 +00:00
|
|
|
config: inject.service(),
|
|
|
|
|
2017-09-28 17:04:33 +00:00
|
|
|
resetController(controller, isExiting) {
|
|
|
|
if (isExiting) {
|
|
|
|
controller.set('error', null);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2017-09-26 23:37:08 +00:00
|
|
|
actions: {
|
|
|
|
didTransition() {
|
2017-10-23 17:21:44 +00:00
|
|
|
if (!this.get('config.isTest')) {
|
|
|
|
window.scrollTo(0, 0);
|
|
|
|
}
|
2017-09-26 23:37:08 +00:00
|
|
|
},
|
2017-09-28 17:04:33 +00:00
|
|
|
|
2017-10-12 23:56:20 +00:00
|
|
|
willTransition() {
|
|
|
|
this.controllerFor('application').set('error', null);
|
|
|
|
},
|
|
|
|
|
2017-09-28 17:04:33 +00:00
|
|
|
error(error) {
|
|
|
|
this.controllerFor('application').set('error', error);
|
|
|
|
},
|
2017-09-26 23:37:08 +00:00
|
|
|
},
|
|
|
|
});
|