Created
June 2, 2014 09:18
-
-
Save fatuk/1bd8f26ec75529f39b55 to your computer and use it in GitHub Desktop.
To Stas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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