Fix alt-n again

This commit is contained in:
Tor Hveem 2014-02-28 00:31:32 +01:00
parent 4fccf9dc8d
commit 5dd11d72c0
2 changed files with 6 additions and 2 deletions

View File

@ -115,7 +115,7 @@
<li>ALT-a: Focus on next buffer with activity</li>
<li>ALT-&lt;: Switch to previous buffer</li>
<li>ALT-g: Focus on buffer list filter</li>
<li>escape: disconnect</li>
<li>Esc: disconnect</li>
<li>arrow keys: history navigation</li>
</ul>
</div>

View File

@ -915,6 +915,10 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
}
}
};
// Helper function since the keypress handler is in a different scope
$rootScope.toggleNicklist = function() {
$scope.nonicklist = !$scope.nonicklist;
}
$scope.handleSearchBoxKey = function($event) {
@ -1103,7 +1107,7 @@ weechat.directive('inputBar', function() {
// Left Alt+n -> toggle nicklist
if ($event.altKey && !$event.ctrlKey && code === 78) {
$event.preventDefault();
$scope.nonicklist = !$scope.nonicklist;
$rootScope.toggleNicklist();
return true;
}