Auto-close keyboard when opening sidebar (bufferlist)

This is for mobile
This commit is contained in:
Lorenz Hübschle-Schneider 2014-08-13 09:22:41 +01:00
parent e46efba5cf
commit ae5f0effcf

View file

@ -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() {