From ae5f0effcf9b725d046744cddd9e7475289fc58f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Wed, 13 Aug 2014 09:22:41 +0100 Subject: [PATCH] Auto-close keyboard when opening sidebar (bufferlist) This is for mobile --- js/glowingbear.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/glowingbear.js b/js/glowingbear.js index d31695a..ac4cd1e 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -907,6 +907,12 @@ 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(); + }); + } }; $rootScope.hideSidebar = function() {