diff --git a/index.html b/index.html
index 377755c..6ef6436 100644
--- a/index.html
+++ b/index.html
@@ -18,7 +18,7 @@
-
+
diff --git a/js/websockets.js b/js/websockets.js
index 98f86e4..21c745b 100644
--- a/js/websockets.js
+++ b/js/websockets.js
@@ -497,11 +497,9 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
// Find next buffer with activity and switch to it
angular.forEach($scope.buffers, function(buffer) {
if(buffer.notification) {
- console.log('a', buffer.id);
$scope.setActiveBuffer(buffer.id);
return false;
}else if((parseInt(buffer.unread) || 0) > 0) {
- console.log('b',buffer.id);
$scope.setActiveBuffer(buffer.id);
return false;
}
@@ -510,15 +508,19 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
}
$scope.handleKeyPress = function($event) {
+ // Support different browser quirks
+ var code = $event.keyCode ? $event.keyCode : $event.charCode;
+
//console.log('keypress', $event.charCode, $event.altKey);
+
// Handle alt-a
- if($event.altKey && $event.charCode == '97') {
+ if($event.altKey && (code == 97 || code == 65)) {
$event.preventDefault();
$rootScope.switchToActivityBuffer();
return true;
}
// Handle ctrl-g
- if($event.ctrlKey && $event.charCode == '103') {
+ if($event.ctrlKey && (code == 103 || code == 71)) {
document.querySelector('#bufferFilter').focus();
return true;
}