From 4bc77a294dc35a8a41f0dbdc8a723322b9eebafc Mon Sep 17 00:00:00 2001 From: Jeremy Mahieu Date: Mon, 16 Dec 2019 21:22:48 +0100 Subject: [PATCH 1/2] Hide sidebar for all widths accoring to state. And always check if mobile to hide it or not --- css/glowingbear.css | 11 ++++++----- js/glowingbear.js | 4 +--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/css/glowingbear.css b/css/glowingbear.css index 6dc1524..4cd92f7 100644 --- a/css/glowingbear.css +++ b/css/glowingbear.css @@ -263,6 +263,11 @@ input[type=text], input[type=password], #sendMessage { #sidebar.ng-hide { width: 0; } + +#sidebar[data-state=hidden] { + transform: translate(-200px,0); + -webkit-transform: translate(-200px,0); +} #nicklist { position: fixed; @@ -400,6 +405,7 @@ td.time { margin-left: 0; padding-left: 145px; } + .footer.withnicklist { padding-right: 100px; } @@ -794,11 +800,6 @@ img.emojione { -webkit-transform: translate(0,0); /* Safari */ } - #sidebar[data-state=hidden] { - transform: translate(-200px,0); - -webkit-transform: translate(-200px,0); - } - .content[sidebar-state=visible] #bufferlines, .content[sidebar-state=visible] .footer { margin-left: 0px; transform: translate(200px,0); diff --git a/js/glowingbear.js b/js/glowingbear.js index 717831f..e32587f 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -576,12 +576,10 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', // Recalculation fails when not connected if ($rootScope.connected) { // Show the sidebar if switching away from mobile view, hide it when switching to mobile - // Wrap in a condition so we save ourselves the $apply if nothing changes (50ms or more) - if ($scope.wasMobileUi && !utils.isMobileUi()) { + if (!utils.isMobileUi()) { $scope.showSidebar(); $scope.updateShowNicklist(); } - $scope.wasMobileUi = utils.isMobileUi(); $scope.calculateNumLines(); // if we're scrolled to the bottom, scroll down to the same position after the resize From 7982f46e6c045d47e7ad6f8cc7e1ee8e92c36478 Mon Sep 17 00:00:00 2001 From: Jeremy Mahieu Date: Mon, 16 Dec 2019 23:25:04 +0100 Subject: [PATCH 2/2] Delete unused references to wasMobileUi --- js/glowingbear.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/js/glowingbear.js b/js/glowingbear.js index e32587f..40d7971 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -319,11 +319,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', } }); - $rootScope.wasMobileUi = false; - if (utils.isMobileUi()) { - $rootScope.wasMobileUi = true; - } - if (!settings.fontfamily) { if (utils.isMobileUi()) { settings.fontfamily = 'sans-serif';