Show sidebar when switching from mobile to desktop view
(or the other way around)
This commit is contained in:
parent
24a7fe2d42
commit
554b16698a
1 changed files with 6 additions and 0 deletions
|
@ -851,6 +851,12 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
|
||||||
window.addEventListener("resize", _.debounce(function() {
|
window.addEventListener("resize", _.debounce(function() {
|
||||||
// Recalculation fails when not connected
|
// Recalculation fails when not connected
|
||||||
if ($rootScope.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.showSidebar === $scope.isMobileDevice()) {
|
||||||
|
$scope.showSidebar = !$scope.showSidebar;
|
||||||
|
$scope.$apply();
|
||||||
|
}
|
||||||
$scope.calculateNumLines();
|
$scope.calculateNumLines();
|
||||||
}
|
}
|
||||||
}, 100));
|
}, 100));
|
||||||
|
|
Loading…
Reference in a new issue