From 58905ec721fb7fb66c8178aa39e8912b95d928d1 Mon Sep 17 00:00:00 2001 From: Adam Shaw Date: Sun, 3 Aug 2014 23:02:04 -0700 Subject: [PATCH] allow eventLimitClick to return a value --- src/common/DayGrid.limit.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/common/DayGrid.limit.js b/src/common/DayGrid.limit.js index 98d2875..b7c363a 100644 --- a/src/common/DayGrid.limit.js +++ b/src/common/DayGrid.limit.js @@ -192,14 +192,9 @@ $.extend(DayGrid.prototype, { var reslicedAllSegs = _this.resliceDaySegs(allSegs, date); var reslicedHiddenSegs = _this.resliceDaySegs(hiddenSegs, date); - if (clickOption === 'popover') { - _this.showSegPopover(date, cell, moreEl, reslicedAllSegs); - } - else if (typeof clickOption === 'string') { // a view name - view.calendar.zoomTo(date, clickOption); - } - else if (typeof clickOption === 'function') { - view.trigger('eventLimitClick', null, { + if (typeof clickOption === 'function') { + // the returned value can be an atomic option + clickOption = view.trigger('eventLimitClick', null, { date: date, dayEl: dayEl, moreEl: moreEl, @@ -207,6 +202,13 @@ $.extend(DayGrid.prototype, { hiddenSegs: reslicedHiddenSegs }, ev); } + + if (clickOption === 'popover') { + _this.showSegPopover(date, cell, moreEl, reslicedAllSegs); + } + else if (typeof clickOption === 'string') { // a view name + view.calendar.zoomTo(date, clickOption); + } }); },