From 5dd11d72c0f1d353175d07554ff0998644330514 Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Fri, 28 Feb 2014 00:31:32 +0100 Subject: [PATCH] Fix alt-n again --- index.html | 2 +- js/glowingbear.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 682c5e9..9d36cea 100644 --- a/index.html +++ b/index.html @@ -115,7 +115,7 @@
  • ALT-a: Focus on next buffer with activity
  • ALT-<: Switch to previous buffer
  • ALT-g: Focus on buffer list filter
  • -
  • escape: disconnect
  • +
  • Esc: disconnect
  • arrow keys: history navigation
  • diff --git a/js/glowingbear.js b/js/glowingbear.js index 79cf886..32cbb6c 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -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; }