Add contact/room with enter

This commit is contained in:
Sebastien Hut 2014-11-18 00:40:08 +01:00
parent 536698310b
commit 7b6dba8132
1 changed files with 14 additions and 0 deletions

View File

@ -25,7 +25,9 @@ module.exports = HumanView.extend({
'click .reconnect': 'handleReconnect', 'click .reconnect': 'handleReconnect',
'click .logout': 'handleLogout', 'click .logout': 'handleLogout',
'click .addContact': 'handleAddContact', 'click .addContact': 'handleAddContact',
'keydown #addcontact': 'keyDownAddContact',
'click .joinMUC': 'handleJoinMUC', 'click .joinMUC': 'handleJoinMUC',
'keydown #joinmuc': 'keyDownJoinMUC',
'blur #me .status': 'handleStatusChange' 'blur #me .status': 'handleStatusChange'
}, },
classBindings: { classBindings: {
@ -101,6 +103,12 @@ module.exports = HumanView.extend({
return false; return false;
}, },
keyDownAddContact: function (e) {
if (e.which === 13 && !e.shiftKey) {
this.handleAddContact(e);
return false;
}
},
handleJoinMUC: function (e) { handleJoinMUC: function (e) {
e.preventDefault(); e.preventDefault();
@ -117,5 +125,11 @@ module.exports = HumanView.extend({
}); });
me.mucs.save(); me.mucs.save();
me.mucs.get(mucjid).join(); me.mucs.get(mucjid).join();
},
keyDownJoinMUC: function (e) {
if (e.which === 13 && !e.shiftKey) {
this.handleJoinMUC(e);
return false;
}
} }
}); });