From ac4bef3c47653c129bc96da8c12256a40eb8985f Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Fri, 22 Jan 2016 00:22:08 +0000 Subject: [PATCH] In single week view, only show the date labels once --- calendar/js/app.js | 4 ++++ calendar/js/et2_widget_timegrid.js | 13 +++++-------- calendar/templates/default/app.css | 28 +++++++++++++++++++++++++++- 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/calendar/js/app.js b/calendar/js/app.js index 5141e04479..68b2eb4982 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -543,6 +543,7 @@ app.classes.calendar = AppJS.extend( parent = widget._parent; var idx = sortedArr.indexOf(widget.options.owner); children.splice(idx,0,widget); + widget.resize(); },this,et2_calendar_timegrid); } parent._children.sort(function(a,b) { @@ -1999,6 +2000,9 @@ app.classes.calendar = AppJS.extend( // We'll modify this one, so it needs to be a new object var date = new Date(state.state.first); + // Hide all but the first day header + $j(grid.getDOMNode()).toggleClass('hideDayColHeader',state.state.view == 'week'); + // Determine the different end date & varying values switch(state.state.view) { diff --git a/calendar/js/et2_widget_timegrid.js b/calendar/js/et2_widget_timegrid.js index 3bcadcab2f..bdb85d8198 100644 --- a/calendar/js/et2_widget_timegrid.js +++ b/calendar/js/et2_widget_timegrid.js @@ -1690,15 +1690,12 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes if(!widget.disabled) widget.set_granularity(0); },this, et2_calendar_timegrid); } - if(this.options.height+"px" !== this.div.css('height')) - { - this.div.css('height', this.options.height); + this.div.css('height', this.options.height); - // Re-do time grid - if(!this.update_timer) this._drawTimes(); - - // Just re-did everything, no need to do more - return; + // Re-do time grid + if(!this.update_timer) + { + this._drawTimes(); } // Try to resize width, though animations cause problems diff --git a/calendar/templates/default/app.css b/calendar/templates/default/app.css index c10925f0c0..3cc153b421 100644 --- a/calendar/templates/default/app.css +++ b/calendar/templates/default/app.css @@ -203,6 +203,27 @@ e.g. the div with class calendar_calTimeGrid is generated by the timeGridWidget right: 0px; position: absolute; } + +/* +Show the day headers for single week view only once. +Hide subsequent headers in week view with non-consolidated owners +*/ +#calendar-view_view.hideDayColHeader tr:not(:first-of-type) .calendar_calGridHeader .calendar_calDayColHeader +{ + min-height: 0.5em; +} +#calendar-view_view.hideDayColHeader tr:not(:first-of-type) .calendar_calGridHeader .calendar_calDayColHeader > div[data-date] { + display:none; +} +#calendar-view_view.hideDayColHeader tr:not(:first-of-type) .calendar_calGridHeader > ul > li { + white-space:nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +#calendar-view_view.hideDayColHeader tr:not(:first-of-type) .calendar_calGridHeader > ul > li:hover { + overflow: visible; +} + /* single row in the time-line you dont need to set a bgcolor, but you can */ .calendar_calTimeRow { @@ -367,6 +388,11 @@ e.g. the div with class calendar_calTimeGrid is generated by the timeGridWidget width: 58px; text-align: center; } + +.calendar_calGridHeader > ul { + position: absolute; + width: 55px; +} .calendar_TimeGridNoLabel > .calendar_calGridHeader > ul { display: none; } @@ -423,7 +449,7 @@ e.g. the div with class calendar_calTimeGrid is generated by the timeGridWidget z-index: 29; border-bottom: 1px solid silver; border-top: 1px solid silver; - min-height: 2ex; + min-height: 1ex; flex: 0 0 auto; } #calendar-view_view tbody.ui-sortable {