From cd8632e3549b3bcf44ff82f445bb5a0f6730acd6 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 24 Mar 2016 17:28:51 +0000 Subject: [PATCH] Some fine adjustments for display of events right at the edge of the work day --- calendar/js/et2_widget_daycol.js | 6 ++++-- calendar/js/et2_widget_timegrid.js | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/calendar/js/et2_widget_daycol.js b/calendar/js/et2_widget_daycol.js index 6916ed0fc0..80682e5d5b 100644 --- a/calendar/js/et2_widget_daycol.js +++ b/calendar/js/et2_widget_daycol.js @@ -530,11 +530,13 @@ var et2_calendar_daycol = (function(){ "use strict"; return et2_valueWidget.exte // elem is jquery div of event function isHidden(elem) { - var docViewTop = timegrid.scrolling.scrollTop(), + // Add an extra 5px top and bottom to include events just on the + // edge of visibility + var docViewTop = timegrid.scrolling.scrollTop() + 5, docViewBottom = docViewTop + ( this.display_settings.granularity === 0 ? this.event_wrapper.height() : - timegrid.scrolling.height() + timegrid.scrolling.height() - 10 ), elemTop = elem.position().top, elemBottom = elemTop + elem.outerHeight(true); diff --git a/calendar/js/et2_widget_timegrid.js b/calendar/js/et2_widget_timegrid.js index e9570182bd..b67492e07d 100644 --- a/calendar/js/et2_widget_timegrid.js +++ b/calendar/js/et2_widget_timegrid.js @@ -797,7 +797,9 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view. // Scroll to start of day this._top_time = (wd_start * this.rowHeight) / this.options.granularity; - this.scrolling.scrollTop(this._top_time); + // For some reason on Chrome & FF this doesn't quite get the day start + // to the top, so add 2px; + this.scrolling.scrollTop(this._top_time+2); if(this.rowHeight != old_height) {