Added Unix-like chat clear keybindings. Now only clears the chat if the main input is focused.

This commit is contained in:
William Boman 2014-09-19 13:52:36 +02:00
parent ab80c91054
commit 2d618969e4
1 changed files with 8 additions and 3 deletions

View File

@ -568,9 +568,14 @@ $(function() {
}); });
Mousetrap.bind([ Mousetrap.bind([
"command+k" "command+k",
], function (e, keys) { "ctrl+l",
chat.find(".active .chat .messages").empty(); "ctrl+shift+l"
], function (e) {
// Only clear the chat if the main input is focused.
if( e.target === input[0] ) {
chat.find(".active .chat .messages").empty();
}
}); });
function complete(word) { function complete(word) {