Do not handle keypress when not connected

This commit is contained in:
Philippe Proulx 2013-10-27 03:23:49 -04:00
parent 07481825e1
commit 1eee866347

View file

@ -609,6 +609,11 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
}
$scope.handleKeyPress = function($event) {
// don't do anything if not connected
if (!$rootScope.connected) {
return true;
}
// Support different browser quirks
var code = $event.keyCode ? $event.keyCode : $event.charCode;