Skip to content

Instantly share code, notes, and snippets.

@fatuk
Created June 2, 2014 09:18
Show Gist options
  • Save fatuk/1bd8f26ec75529f39b55 to your computer and use it in GitHub Desktop.
Save fatuk/1bd8f26ec75529f39b55 to your computer and use it in GitHub Desktop.
To Stas
var MainView = Backbone.View.extend({
el: $('.js-messagesMainView'),
events: {
'change .js-statusFilterInput': 'filter',
'click .js-checkboxFilterAll': 'filter'
},
initialize: function() {
dialogsCollection.on('sync', function(e) {
console.log(e);
$('.preloader').hide();
});
},
filter: function (e) {
$('.preloader').show();
var serialized = mainView.$('.js-statusFilterForm, #messagesSearchInput').serializeArray();
dialogsCollection.fetch({
method: 'post',
data: serialized,
reset: true
});
dialogsView.$el.html('');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment