Add back button to compose view
This commit is contained in:
parent
fedfdcdd7e
commit
6d81011f6a
6 changed files with 27 additions and 9 deletions
|
@ -23,6 +23,7 @@
|
|||
this.$gutter = $('#gutter');
|
||||
this.$contacts = $('#contacts');
|
||||
this.$fab = this.$el.find('.fab');
|
||||
this.$back = this.$el.find('.back');
|
||||
|
||||
this.newConversationView = new Whisper.NewConversationView();
|
||||
this.newConversationView.$el.hide().appendTo(this.$gutter);
|
||||
|
@ -45,6 +46,7 @@
|
|||
}.bind(this));
|
||||
},
|
||||
events: {
|
||||
'click .back': 'hideCompose',
|
||||
'click .fab': 'showCompose',
|
||||
'keyup input.new-message': 'compose'
|
||||
},
|
||||
|
@ -53,13 +55,17 @@
|
|||
this.$contacts.hide();
|
||||
this.newConversationView.$el.show();
|
||||
this.newConversationView.reset();
|
||||
this.$back.show();
|
||||
},
|
||||
hideCompose: function() {
|
||||
this.newConversationView.$el.hide();
|
||||
this.$contacts.show();
|
||||
this.$fab.show();
|
||||
this.$back.hide();
|
||||
},
|
||||
compose: function(e) {
|
||||
if (e.keyCode === 27) {
|
||||
// hide compose
|
||||
this.newConversationView.$el.hide();
|
||||
this.$contacts.show();
|
||||
this.$fab.show();
|
||||
this.hideCompose();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue