Skip to content

Instantly share code, notes, and snippets.

@roykolak
Created August 11, 2011 20:38
Show Gist options
  • Save roykolak/1140698 to your computer and use it in GitHub Desktop.
Save roykolak/1140698 to your computer and use it in GitHub Desktop.
FilterView = Backbone.View.extend({
initialize: function() {
$(this.el).html('').hide();
},
render: function(results) {
var self = this;
$('#filterViewTemplate').tmpl(this.model.toJSON()).appendTo($(this.el));
$(this.el).fadeIn("fast", function() {
Visit.search(self.model.options(), function(results) {
dateVisits = groupResults(results);
$.each(dateVisits.models, function(i, dateVisit) {
var dateVisitView = new DateVisitView({model: dateVisit});
$('.content', self.el).append(dateVisitView.render().el);
});
self.stickHeaders($('.content', self.el));
});
});
},
stickHeaders: function(container) {
$(container).find('.date').stickySectionHeaders({
stickyClass:'date_interval', padding:48
});
$(container).find('.time').stickySectionHeaders({
stickyClass:'time_interval', padding:48
});
$(window).scrollTop(40);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment