diff --git a/directives/input.html b/directives/input.html index 58a72ed..6f1e4b6 100644 --- a/directives/input.html +++ b/directives/input.html @@ -1,6 +1,6 @@
- diff --git a/index.html b/index.html index 6cae901..1d034f1 100644 --- a/index.html +++ b/index.html @@ -14,10 +14,10 @@ - - - - + + + + diff --git a/js/glowingbear.js b/js/glowingbear.js index 0efde02..ac4cd1e 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -907,9 +907,15 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', $scope.showSidebar = function() { document.getElementById('sidebar').setAttribute('data-state', 'visible'); document.getElementById('content').setAttribute('sidebar-state', 'visible'); + if ($rootScope.isMobileUi()) { + // de-focus the input bar when opening the sidebar on mobile, so that the keyboard goes down + _.each(document.getElementsByTagName('textarea'), function(elem) { + elem.blur(); + }); + } }; - $scope.hideSidebar = function() { + $rootScope.hideSidebar = function() { if ($rootScope.isMobileUi()) { document.getElementById('sidebar').setAttribute('data-state', 'hidden'); document.getElementById('content').setAttribute('sidebar-state', 'hidden'); @@ -1394,6 +1400,10 @@ weechat.directive('inputBar', function() { return document.querySelector('textarea#' + $scope.inputId); }; + $scope.hideSidebar = function() { + $rootScope.hideSidebar(); + }; + $scope.completeNick = function() { // input DOM node var inputNode = $scope.getInputNode();