Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:nko2/sf2-boys into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
avalanche123 committed Aug 28, 2011
2 parents efc650b + 378ac38 commit a79d380
Showing 1 changed file with 53 additions and 27 deletions.
80 changes: 53 additions & 27 deletions public/javascripts/twalks.js
Expand Up @@ -295,6 +295,7 @@
window.App.router.navigate('events/' + model.get('_id'), true);
}
, error: function(model, err) {
console.log(err);
alertMessage('error', 'Oops! There was a problem submitting this form. Please fix the errors below and try again.');
var errors = $.parseJSON(err.responseText)
, self = this;
Expand Down Expand Up @@ -405,15 +406,20 @@
eventsCollection.url = '/events.json';
}

eventsCollection.fetch({ success: function() {
if (withoutAnimation) {
self.displayContainer(self.eventsListView.render().el);
} else {
self.hideAndEmptyContainer(function(){
eventsCollection.fetch({
success: function() {
if (withoutAnimation) {
self.displayContainer(self.eventsListView.render().el);
});
} else {
self.hideAndEmptyContainer(function(){
self.displayContainer(self.eventsListView.render().el);
});
}
}
}, error: function(){ alertMessage('warning', 'We encountered an error fetching your events.'); });
, error: function(){
alertMessage('warning', 'We encountered an error fetching your events.');
}
});
}
, listMy: function() {
this.showProgressBar();
Expand All @@ -425,11 +431,16 @@
, collection = new App.Collections.EventsMy
, listView = new App.Views.EventsList({ collection: collection });

collection.fetch({ success: function() {
self.hideAndEmptyContainer(function() {
self.displayContainer(listView.render().el);
});
}, error: function(){ alertMessage('warning', 'We encountered an error fetching your events.'); });
collection.fetch({
success: function() {
self.hideAndEmptyContainer(function() {
self.displayContainer(listView.render().el);
});
}
, error: function(){
alertMessage('warning', 'We encountered an error fetching your events.');
}
});
}
, listCurrent: function() {
this.showProgressBar();
Expand All @@ -441,11 +452,16 @@
, collection = new App.Collections.EventsCurrent
, listView = new App.Views.EventsList({ collection: collection });

collection.fetch({ success: function() {
self.hideAndEmptyContainer(function() {
self.displayContainer(listView.render().el);
});
}, error: function(){ alertMessage('warning', 'We encountered an error fetching ongoing events.'); });
collection.fetch({
success: function() {
self.hideAndEmptyContainer(function() {
self.displayContainer(listView.render().el);
});
}
, error: function(){
alertMessage('warning', 'We encountered an error fetching ongoing events.');
}
});
}
, listUpcoming: function() {
this.showProgressBar();
Expand All @@ -457,11 +473,16 @@
, collection = new App.Collections.EventsUpcoming
, listView = new App.Views.EventsList({ collection: collection });

collection.fetch({ success: function() {
self.hideAndEmptyContainer(function() {
self.displayContainer(listView.render().el);
});
}, error: function(){ alertMessage('warning', 'We encountered an error fetching upcoming events.'); });
collection.fetch({
success: function() {
self.hideAndEmptyContainer(function() {
self.displayContainer(listView.render().el);
});
}
, error: function(){
alertMessage('warning', 'We encountered an error fetching upcoming events.');
}
});
}
, showEvent: function(id) {
this.showProgressBar();
Expand All @@ -478,11 +499,16 @@
, self = this
;

event.fetch({ success: function() {
self.hideAndEmptyContainer(function(){
self.displayContainer(view.render().el);
});
}, error: function(){ alertMessage('warning', 'We encountered an error fetching this event.'); });
event.fetch({
success: function() {
self.hideAndEmptyContainer(function(){
self.displayContainer(view.render().el);
});
}
, error: function(){
alertMessage('warning', 'We encountered an error fetching this event.');
}
});
}
, showProgressBar: function() {
$('li.user', this.$secondaryNav).stop().hide();
Expand Down

0 comments on commit a79d380

Please sign in to comment.