Hide sidebar when focusing input bar

This is for mobile
This commit is contained in:
Lorenz Hübschle-Schneider 2014-08-13 08:39:32 +01:00
commit f7aa7a0871
2 changed files with 6 additions and 2 deletions

View file

@ -909,7 +909,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
document.getElementById('content').setAttribute('sidebar-state', 'visible');
};
$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 +1394,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();