From be9fabb2bc4c8f9c4aa80049da749701593ff7be Mon Sep 17 00:00:00 2001 From: Szymon Nowak Date: Tue, 25 Mar 2014 00:15:19 +0100 Subject: [PATCH] Display about page on the first load --- app/scripts/app.js | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/app/scripts/app.js b/app/scripts/app.js index 412848b..cd5dadc 100644 --- a/app/scripts/app.js +++ b/app/scripts/app.js @@ -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'; } } });