Skip to content

Commit

Permalink
new board
Browse files Browse the repository at this point in the history
  • Loading branch information
lily committed Jun 9, 2015
1 parent bfc6be7 commit 7a1b88c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion app/assets/javascripts/views/boards/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Bellino.Views.BoardForm = Backbone.View.extend({
className: 'board-new new-board-form',
tagName: 'form',

events: {
'keypress .new-board-title': 'checkEnter'
},

render: function () {
var view = this.template();
this.$el.html(view);
Expand All @@ -19,12 +23,19 @@ Bellino.Views.BoardForm = Backbone.View.extend({
success: function () {
Bellino.Collections.boards.add(board);
$(".tcon").removeClass("tcon-transform");
// Backbone.history.navigate("/#", { trigger: true });
this.closeForm();
}.bind(this)
});
},

checkEnter: function (event) {
if (event.which == 13) {
this.saveBoard();
$("html, body").animate({ scrollTop: $(document).height() }, "slow");
return false;
}
},

closeForm: function () {
$(".modal-close").removeClass("dark-modal");
$("body").removeClass("modal-is-open");
Expand Down

0 comments on commit 7a1b88c

Please sign in to comment.