33 lines
1002 B
JavaScript
33 lines
1002 B
JavaScript
import Route from '@ember/routing/route';
|
|
import { htmlSafe } from '@ember/template';
|
|
|
|
export default Route.extend({
|
|
model() {
|
|
const me = this;
|
|
me._super(...arguments);
|
|
return me.get('store').ajaxGet('home-page/applying');
|
|
},
|
|
afterModel(model) {
|
|
console.log('home page loaded: ', model);
|
|
if (model.content) {
|
|
// model.content =
|
|
model.content = htmlSafe(model.content);
|
|
}
|
|
// this.transitionTo('app.list', 1);
|
|
},
|
|
actions: {
|
|
didTransition() {
|
|
if (window.localStorage) {
|
|
const prevURL = window.localStorage.getItem('prevURL');
|
|
if (prevURL) {
|
|
window.localStorage.removeItem('prevURL');
|
|
if (prevURL != window.location.href) {
|
|
window.location.href = prevURL;
|
|
}
|
|
}
|
|
}
|
|
return true; // Bubble the didTransition event
|
|
}
|
|
}
|
|
});
|