allow eventLimitClick to return a value

This commit is contained in:
Adam Shaw
2014-08-03 23:02:04 -07:00
parent 604a3faab5
commit 58905ec721
+10 -8
View File
@@ -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);
}
});
},