From 5be2f027e4d3172bc07f6302f2c1a3ca7619ec36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Sun, 18 Mar 2018 11:34:53 +0100 Subject: [PATCH 1/3] Fix nicklist on iOS --- css/glowingbear.css | 4 ++++ index.html | 14 +++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/css/glowingbear.css b/css/glowingbear.css index 9b9e16c..e5faf52 100644 --- a/css/glowingbear.css +++ b/css/glowingbear.css @@ -835,6 +835,10 @@ img.emojione { bottom: 0px; } + .content[sidebar-state=visible] #nicklist { + display: none; + } + .navbar-fixed-bottom { margin: 0; } diff --git a/index.html b/index.html index e8063ce..896e178 100644 --- a/index.html +++ b/index.html @@ -310,14 +310,14 @@ npm run build-electron-{windows, darwin, linux} +
+ +
-
-
    -
  • - -
  • -
-
From 66c8c53b41b615147a836d63571964d79310d5ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Sun, 18 Mar 2018 11:35:07 +0100 Subject: [PATCH 2/3] Fix nicklist swipe behaviour for buffers without a nicklist We shouldn't update the swipe state if the active doesn't have a nicklist. The (previously) required double-right-swipe to get to the sidebar was confusing and a bug --- js/glowingbear.js | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/js/glowingbear.js b/js/glowingbear.js index 227f32d..3276cb5 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -356,7 +356,9 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', } else if ($scope.swipeStatus === 0) { // show nicklist $scope.swipeStatus = -1; - $scope.updateShowNicklist(); + if (!$scope.updateShowNicklist()) { + $scope.swipeStatus = 0; + } } else if ($scope.swipeStatus === -1) { /* do nothing */ } else { @@ -761,26 +763,30 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', $scope.updateShowNicklist(); }); $scope.showNicklist = false; - // Utility function that template can use to check if nicklist should - // be displayed for current buffer or not - // is called on buffer switch and certain swipe actions + // Utility function that template can use to check if nicklist should be + // displayed for current buffer or not is called on buffer switch and + // certain swipe actions. Sets $scope.showNicklist accordingly and returns + // whether the buffer even has a nicklist to show. $scope.updateShowNicklist = function() { - $scope.showNicklist = (function() { + // returns array of booleans: [show nicklist, buffer has nicklist] + var result = (function() { var ab = models.getActiveBuffer(); // Check whether buffer exists and nicklist is non-empty if (!ab || ab.isNicklistEmpty()) { - return false; + return [false, false]; } // Check if nicklist is disabled in settings (ignored on mobile) if (!utils.isMobileUi() && settings.nonicklist) { - return false; + return [false, true]; } // mobile: hide nicklist unless overriden by setting or swipe action if (utils.isMobileUi() && !settings.alwaysnicklist && $scope.swipeStatus !== -1) { - return false; + return [false, true]; } - return true; + return [true, true]; })(); + $scope.showNicklist = result[0]; + return result[1]; }; //XXX not sure whether this belongs here From fe3b975c6ee222a77a80955ca2134470c5941f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Mon, 19 Mar 2018 11:03:04 +0100 Subject: [PATCH 3/3] Clean up updateShowNicklist() --- js/glowingbear.js | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/js/glowingbear.js b/js/glowingbear.js index 3276cb5..32b4193 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -768,25 +768,24 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', // certain swipe actions. Sets $scope.showNicklist accordingly and returns // whether the buffer even has a nicklist to show. $scope.updateShowNicklist = function() { - // returns array of booleans: [show nicklist, buffer has nicklist] - var result = (function() { - var ab = models.getActiveBuffer(); - // Check whether buffer exists and nicklist is non-empty - if (!ab || ab.isNicklistEmpty()) { - return [false, false]; - } - // Check if nicklist is disabled in settings (ignored on mobile) - if (!utils.isMobileUi() && settings.nonicklist) { - return [false, true]; - } - // mobile: hide nicklist unless overriden by setting or swipe action - if (utils.isMobileUi() && !settings.alwaysnicklist && $scope.swipeStatus !== -1) { - return [false, true]; - } - return [true, true]; - })(); - $scope.showNicklist = result[0]; - return result[1]; + var ab = models.getActiveBuffer(); + // Check whether buffer exists and nicklist is non-empty + if (!ab || ab.isNicklistEmpty()) { + $scope.showNicklist = false; + return false; + } + // Check if nicklist is disabled in settings (ignored on mobile) + if (!utils.isMobileUi() && settings.nonicklist) { + $scope.showNicklist = false; + return true; + } + // mobile: hide nicklist unless overriden by setting or swipe action + if (utils.isMobileUi() && !settings.alwaysnicklist && $scope.swipeStatus !== -1) { + $scope.showNicklist = false; + return true; + } + $scope.showNicklist = true; + return true; }; //XXX not sure whether this belongs here