Skip to content

Commit

Permalink
(js) Always show center list when no msg selected
Browse files Browse the repository at this point in the history
Fixes #4269
  • Loading branch information
cgx committed Sep 5, 2017
1 parent 8697b6c commit 141b3af
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 37 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Bug fixes
- [web] fixed display of error when the mail editor is in a popup
- [web] attachments are not displayed on IOS (#4150)
- [web] fixed parsing of pasted email addresses from Spreadsheet (#4258)
- [web] messages list not accessible when changing mailbox in expanded mail view (#4269)

3.2.10 (2017-07-05)
-------------------
Expand Down
2 changes: 1 addition & 1 deletion UI/Templates/MailerUI/UIxMailFolderTemplate.wox
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns="http://www.w3.org/1999/xhtml"
xmlns:var="http://www.skyrix.com/od/binding"
xmlns:label="OGo:label">
<div class="view-list" layout="column" ng-class="{'view-list--close': centerIsClose}">
<div class="view-list" layout="column" ng-class="{'view-list--close': mailbox.centerIsClose(centerIsClose)}">

<!-- in virtual mailbox mode -->
<md-toolbar class="md-whiteframe-z1 md-hue-3"
Expand Down
74 changes: 38 additions & 36 deletions UI/WebServerResources/js/Common/navController.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */

/**
* @type {angular.Module}
*/
(function () {
(function() {
/* jshint validthis: true */
'use strict';

/**
Expand All @@ -13,23 +11,43 @@
function navController($rootScope, $scope, $timeout, $interval, $http, $window, $mdSidenav, $mdToast, $mdMedia, $log, sgConstant, sgSettings, Resource, Alarm) {
var resource = new Resource(sgSettings.baseURL(), sgSettings.activeUser());

$scope.isPopup = sgSettings.isPopup;
$scope.activeUser = sgSettings.activeUser();
$scope.baseURL = sgSettings.baseURL();
$scope.leftIsClose = !$mdMedia(sgConstant['gt-md']);
// Don't hide the center list when on a small device
$scope.centerIsClose = !!$window.centerIsClose && !$scope.leftIsClose;
this.$onInit = function() {
$scope.isPopup = sgSettings.isPopup;
$scope.activeUser = sgSettings.activeUser();
$scope.baseURL = sgSettings.baseURL();
$scope.leftIsClose = !$mdMedia(sgConstant['gt-md']);
// Don't hide the center list when on a small device
$scope.centerIsClose = !!$window.centerIsClose && !$scope.leftIsClose;

// Show current day in top bar
$scope.currentDay = window.currentDay;
$timeout(function() {
// Update date when day ends
$interval(function() {
$http.get('../date').then(function(data) {
$scope.currentDay = data;
});
}, 24 * 3600 * 1000);
}, window.currentDay.secondsBeforeTomorrow * 1000);
// Show current day in top bar
$scope.currentDay = window.currentDay;
$timeout(function() {
// Update date when day ends
$interval(function() {
$http.get('../date').then(function(data) {
$scope.currentDay = data;
});
}, 24 * 3600 * 1000);
}, window.currentDay.secondsBeforeTomorrow * 1000);

// Track the 1024px window width threashold
$scope.$watch(function() {
return $mdMedia(sgConstant['gt-md']);
}, function(newVal) {
$scope.isGtMedium = newVal;
if (newVal) {
$scope.leftIsClose = false;
}
});

// Listen to HTTP errors broadcasted from HTTP interceptor
$rootScope.$on('http:Error', onHttpError);

if (sgSettings.activeUser('path').calendar) {
// Fetch Calendar alarms
Alarm.getAlarms();
}
};

$scope.toggleLeft = function() {
if ($scope.isGtMedium) {
Expand Down Expand Up @@ -70,14 +88,6 @@
// var detail = angular.element(document.getElementById('detailView'));
// detail.toggleClass('sg-close');
// };
$scope.$watch(function() {
return $mdMedia(sgConstant['gt-md']);
}, function(newVal) {
$scope.isGtMedium = newVal;
if (newVal) {
$scope.leftIsClose = false;
}
});

function leftIsClose() {
return !$mdSidenav('left').isOpen();
Expand Down Expand Up @@ -106,14 +116,6 @@
else
$log.debug('untrap error');
}

// Listen to HTTP errors broadcasted from HTTP interceptor
$rootScope.$on('http:Error', onHttpError);

if (sgSettings.activeUser('path').calendar) {
// Fetch Calendar alarms
Alarm.getAlarms();
}
}

angular.module('SOGo.Common')
Expand Down
5 changes: 5 additions & 0 deletions UI/WebServerResources/js/Mailer/MailboxController.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@
return vm.selectedFolder.$compact();
}

this.centerIsClose = function(navController_centerIsClose) {
// Allow the messages list to be hidden only if a message is selected
return this.selectedFolder.hasSelectedMessage() && !!navController_centerIsClose;
};

this.sort = function(field) {
vm.selectedFolder.$filter({ sort: field });
};
Expand Down

0 comments on commit 141b3af

Please sign in to comment.