[IMP] im_chat: ESC shortcut to close chat window

Cherry-picked from 0172cfba76ae4509be33220f6d4ef09c005c8312
Closes #2335
This commit is contained in:
Richard Mathot
2014-09-11 16:13:44 +02:00
parent 4530ef5f84
commit 01655be433
+9
View File
@@ -327,6 +327,15 @@
this._go_bottom();
},
keydown: function(e) {
if(e && e.which == 27) {
if(this.$el.prev().find('.oe_im_chatview_input').length > 0){
this.$el.prev().find('.oe_im_chatview_input').focus();
}else{
this.$el.next().find('.oe_im_chatview_input').focus();
}
e.stopPropagation();
this.update_fold_state('closed');
}
if(e && e.which !== 13) {
return;
}