ソースを参照

allow eventLimitClick to return a value

Adam Shaw 11 年 前
コミット
58905ec721
1 ファイル変更10 行追加8 行削除
  1. 10 8
      src/common/DayGrid.limit.js

+ 10 - 8
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);
+				}
 			});
 	},