/public/js/views/post_status.js
http://github.com/bkeepers/monologue · JavaScript · 21 lines · 12 code · 1 blank · 8 comment · 0 complexity · 7c66781f053f7d361e1ddf8b002d6218 MD5 · raw file
- // View to manage posting a new status.
- //
- // Responsibility:
- // Create a status from user input
- //
- // Dependencies:
- // * el - A form element with a textarea
- // * collection - the collection that the status will be created in
- Monologue.View.PostStatus = Backbone.View.extend({
- events: {
- "submit": "submit"
- },
- submit: function(e) {
- e.preventDefault();
- var $input = this.$el.find('textarea');
- this.collection.create({text: $input.val()});
- $input.val('');
- return false;
- }
- });