Skip to content

Commit

Permalink
#623 remove subheader when it is desktop and update css without it
Browse files Browse the repository at this point in the history
  • Loading branch information
asmaNode committed Dec 15, 2021
1 parent d88c1d0 commit 5d8fb7c
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 6 deletions.
14 changes: 12 additions & 2 deletions src/esn.calendar.libs/app/app.constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,28 @@
weekNumbers: true,
weekNumberCalculation: 'ISO',
firstDay: 1,
customButtons: {
refresh_cal: {
text: 'Refresh'
},
planning_cal: {
text: 'Planning'
}
},
header: {
left: 'agendaDay, agendaWeek, month',
center: 'title',
right: 'prev, today, next'
right: 'refresh_cal,prev, today, next , planning_cal'
},
themeButtonIcons: {
today: ' mdi mdi-calendar-today',
month: ' mdi mdi-view-module',
agendaWeek: ' mdi mdi-view-week',
agendaDay: ' mdi mdi-view-day',
prev: ' mdi mdi-chevron-left',
next: ' mdi mdi-chevron-right'
next: ' mdi mdi-chevron-right',
refresh_cal: ' mdi mdi-refresh',
planning_cal: ' mdi mdi-view-list'
},
handleWindowResize: false,
views: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const _ = require('lodash');
$window,
usSpinnerService,
calCachedEventSource,
calendarSidebarService,
calendarCurrentView,
calendarEventSource,
calendarService,
Expand Down Expand Up @@ -95,6 +96,9 @@ const _ = require('lodash');
$scope.uiConfig.calendar.select = select;
$scope.uiConfig.calendar.loading = loading;
$scope.uiConfig.calendar.nextDayThreshold = '00:00';
$scope.uiConfig.calendar.customButtons.refresh_cal.click = refreshCalendar;
$scope.uiConfig.calendar.customButtons.planning_cal.click = showPlanning;

$scope.calendarReady = calendarDeffered.resolve.bind(calendarDeffered);

var rootScopeListeners = [
Expand Down Expand Up @@ -143,6 +147,28 @@ const _ = require('lodash');

windowJQuery.resize($scope.resizeCalendarHeight);
$window.addEventListener('beforeunload', gracePeriodService.flushAllTasks);
toggleSideMenuEvent();
}

function refreshCalendar() {
calCachedEventSource.resetCache();
$rootScope.$broadcast(CAL_EVENTS.CALENDAR_REFRESH);
}

function showPlanning() {
if ($state.includes('calendar.main.planning')) {
$state.go('calendar.main');
} else {
$state.go('calendar.main.planning');
}
}

function toggleSideMenuEvent() {
$rootScope.$on('toggleSideMenu', function() {
const sidebarVisibility = calendarSidebarService.getSidebarVisibility();

calendarSidebarService.setSidebarVisibility(!sidebarVisibility);
});
}

function render(event, element, view) {
Expand Down
12 changes: 11 additions & 1 deletion src/linagora.esn.calendar/app/commons.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@spaceNeededForSubheader: 50px;
@spaceNeededForSubheader: 0;
@calendarLeftPaneWidth: 270px;
@calendarRightPaneWidth: 285px;
@scrollbarWidth: 15px;
Expand Down Expand Up @@ -33,3 +33,13 @@
background-color: @darkenBgColor;
}
}

#sub-header{
display : none !important
}
@media (max-width: @screen-sm-min) {
#sub-header{
display : flex !important
}
}

6 changes: 3 additions & 3 deletions src/linagora.esn.calendar/app/sidebar/sidebar.less
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@

@media (min-width: @screen-md-min) {
.calendar-sidebar {
top: ~"calc(@{header-height-md} + @{sub-header-height-md})";
top: ~"calc(@{header-height-md})";
}
}

@media (min-width: @screen-xl-min) {
.calendar-sidebar {
top: ~"calc(@{header-height-xl} + @{sub-header-height-xl})";
top: ~"calc(@{header-height-xl})";
}
}
}

0 comments on commit 5d8fb7c

Please sign in to comment.