Skip to content

Instantly share code, notes, and snippets.

@rmoura-92
Created September 17, 2013 16:23
Show Gist options
  • Save rmoura-92/6596737 to your computer and use it in GitHub Desktop.
Save rmoura-92/6596737 to your computer and use it in GitHub Desktop.
routes
escapadinhasPagamento: function(id) {
var self = this;
var model;
this.before(function() {
App.Views.Home.hide();
App.Views.Start.holdBackground();
if(localStorage) {
detalhe = localStorage.getItem('escapadinhasLastDetalhe');
if(detalhe) {
App.Collections.Escapadinhas.reset(JSON.parse(detalhe));
}
}
model = App.Collections.Escapadinhas.get(id);
});
this.after(function() {
resumo = new ResumoView({
model: model
});
payment = new PaymentView({
model: model
});
self.AppView.clear();
self.AppView.create({
resumo: resumo,
payment: payment
});
});
},
// mais
areaPessoal: function() {
var self = this;
this.before(function() {
App.Views.Home.hide();
App.Views.Start.holdBackground();
if(localStorage) {
user = localStorage.getItem('user');
if(user) {
App.Collections.Users.reset(JSON.parse(user));
}
}
});
this.after(function() {
mais = new MaisView({
collection: App.Collections.Users
});
sidemais = new SideMaisView({
area: 'pessoal'
});
self.AppView.clear();
self.AppView.create({
sidemais: sidemais,
mais: mais
});
});
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment