From 156640c3ba49339b5ce77fb6a12a3c2394f67eae Mon Sep 17 00:00:00 2001 From: Ailin Nemui Date: Wed, 3 Sep 2014 14:39:38 +0200 Subject: [PATCH] Properly Show and hide the sidebar on mobile layout when using Alt+g --- js/glowingbear.js | 2 +- js/inputbar.js | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/js/glowingbear.js b/js/glowingbear.js index 78da583..20ea209 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -605,7 +605,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', else if (code === 13) { $event.preventDefault(); if ($scope.filteredBuffers.length > 0) { - models.setActiveBuffer($scope.filteredBuffers[0].id); + $scope.setActiveBuffer($scope.filteredBuffers[0].id); } $scope.search = ''; } diff --git a/js/inputbar.js b/js/inputbar.js index 54ea52c..a7fa229 100644 --- a/js/inputbar.js +++ b/js/inputbar.js @@ -167,7 +167,7 @@ weechat.directive('inputBar', function() { }); var activeBufferId = sortedBuffers[bufferNumber]; if (activeBufferId) { - models.setActiveBuffer(activeBufferId[1]); + $scope.$parent.setActiveBuffer(activeBufferId[1]); $event.preventDefault(); } } @@ -236,6 +236,9 @@ weechat.directive('inputBar', function() { // Alt+G -> focus on buffer filter input if ($event.altKey && (code === 103 || code === 71)) { $event.preventDefault(); + if (!$scope.$parent.isSidebarVisible()) { + $scope.$parent.showSidebar(); + } document.getElementById('bufferFilter').focus(); return true; }