Display about page on the first load

This commit is contained in:
Szymon Nowak 2014-03-25 00:15:19 +01:00
parent 94ad43d1a6
commit be9fabb2bc

View File

@ -52,6 +52,24 @@ ShareDrop.App.deferReadiness();
}
})();
ShareDrop.App.ApplicationRoute = Ember.Route.extend({
actions: {
openModal: function (modalName) {
return this.render(modalName, {
outlet: 'modal',
into: 'index'
});
},
closeModal: function () {
return this.disconnectOutlet({
outlet: 'modal',
parentView: 'index'
});
}
}
});
ShareDrop.App.IndexRoute = Ember.Route.extend({
beforeModel: function() {
if (ShareDrop.App.error) {
@ -66,21 +84,10 @@ ShareDrop.App.IndexRoute = Ember.Route.extend({
into: 'application',
outlet: 'about_you'
});
},
actions: {
openModal: function(modalName) {
return this.render(modalName, {
outlet: 'modal',
into: 'index'
});
},
closeModal: function() {
return this.disconnectOutlet({
outlet: 'modal',
parentView: 'index'
});
if (!localStorage.seenInstructions) {
this.send('openModal', 'about');
localStorage.seenInstructions = 'yup';
}
}
});