From e25442abce053c8afe52fd6f90881697182f099d Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 18 Jan 2016 20:55:30 +0000 Subject: [PATCH] Fix clicks on daycol sub-divs were ignored --- calendar/js/et2_widget_timegrid.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/calendar/js/et2_widget_timegrid.js b/calendar/js/et2_widget_timegrid.js index 936e7bd3f0..b4a9971e3c 100644 --- a/calendar/js/et2_widget_timegrid.js +++ b/calendar/js/et2_widget_timegrid.js @@ -1558,13 +1558,22 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes } } } - else if (_ev.target.dataset.date) + else { + var dataset = {}; + var parent = _ev.target; + do + { + dataset = parent.dataset; + parent = parent.parentNode; + } while (jQuery.isEmptyObject(dataset) && parent !== this.node); + if(parent === this.node) return; + // Default handler to open a new event at the selected time var options = { - date: _ev.target.dataset.date || this.day_list[0], - hour: _ev.target.dataset.hour || this.options.day_start, - minute: _ev.target.dataset.minute || 0 + date: dataset.date || this.day_list[0], + hour: dataset.hour || this.options.day_start, + minute: dataset.minute || 0 }; if (this.options.owner != app.calendar.state.owner) {