Adam Shaw пре 11 година
родитељ
комит
5e00ffcc51

+ 5 - 4
src/EventManager.js

@@ -461,6 +461,7 @@ function EventManager(options) { // assumed to be a calendar
 	// Given a raw object with key/value properties, returns an "abstract" Event object.
 	// An "abstract" event is an event that, if recurring, will not have been expanded yet.
 	// Will return `false` when input is invalid.
+	// `source` is optional
 	function buildEventFromInput(input, source) {
 		var out = {};
 		var start, end;
@@ -624,7 +625,7 @@ function EventManager(options) { // assumed to be a calendar
 
 			// iterate through every day in the current range
 			date = _rangeStart.clone().stripTime(); // holds the date of the current day
-			while (date.isBefore(_rangeEnd)) { // QUESTION: is this kosher with an ambiguous date?
+			while (date.isBefore(_rangeEnd)) {
 
 				if (!dowHash || dowHash[date.day()]) { // if everyday, or this particular day-of-week
 
@@ -848,7 +849,7 @@ function EventManager(options) { // assumed to be a calendar
 			className: 'fc-nonbusiness',
 			start: '09:00',
 			end: '17:00',
-			dow: [ 1, 2, 3, 4, 5 ],
+			dow: [ 1, 2, 3, 4, 5 ], // monday - friday
 			rendering: 'inverse-background'
 		};
 		var eventInput;
@@ -908,9 +909,9 @@ function EventManager(options) { // assumed to be a calendar
 	}
 
 
-	// Returns true if the given range (caused by an event drop or a selection) is allowed to exist on the calendar
+	// Returns true if the given range (caused by an event drop/resize or a selection) is allowed to exist
 	// according to the constraint/overlap settings.
-	// `event` is required only in the case of isEventAllowedInRange.
+	// `event` is not required if checking a selection.
 	function isRangeAllowed(start, end, constraint, overlap, event) {
 		var constraintEvents;
 		var anyContainment;

+ 1 - 1
src/agenda/agenda.css

@@ -86,7 +86,7 @@
 	z-index: 5;
 }
 
-.fc-time-grid > .fc-helper-skeleton {
+.fc-time-grid .fc-helper-skeleton {
 	z-index: 6;
 }
 

+ 2 - 1
src/common/DayGrid.limit.js

@@ -1,6 +1,7 @@
 
 /* Methods relate to limiting the number events for a given day on a DayGrid
 ----------------------------------------------------------------------------------------------------------------------*/
+// NOTE: all the segs being passed around in here are foreground segs
 
 $.extend(DayGrid.prototype, {
 
@@ -280,7 +281,7 @@ $.extend(DayGrid.prototype, {
 		var i;
 
 		// render each seg's `el` and only return the visible segs
-		segs = this.renderFgSegEls(segs, true); // disableResizing=true // TODO: filter by only foreground!!!!!
+		segs = this.renderFgSegEls(segs, true); // disableResizing=true
 		this.popoverSegs = segs;
 
 		for (i = 0; i < segs.length; i++) {

+ 3 - 5
src/common/Grid.events.js

@@ -292,7 +292,7 @@ $.extend(Grid.prototype, {
 				}
 			},
 			cellOut: function() { // called before mouse moves to a different cell OR moved out of all cells
-				newStart = null; // mark an invalid drop date
+				newStart = null;
 				view.destroyDrag(); // unrender whatever was done in view.renderDrag
 				mouseFollower.show(); // show in case we are moving out of all cells
 				calendar.enableCursor();
@@ -350,7 +350,7 @@ $.extend(Grid.prototype, {
 			newEnd = null; // end should be cleared
 		}
 
-		// compute what the end date would appear to be if there isn't already one
+		// compute what the end date will appear to be
 		visibleEnd = newEnd || view.calendar.getDefaultEventEnd(!dropDate.hasTime(), newStart);
 
 		return { start: newStart, end: newEnd, visibleEnd: visibleEnd };
@@ -576,7 +576,6 @@ $.extend(Grid.prototype, {
 	// The range objects will cover all the time NOT covered by the events.
 	eventsToInverseRanges: function(events) {
 		var view = this.view;
-		var calendar = view.calendar;
 		var viewStart = view.start.clone().stripZone(); // normalize timezone
 		var viewEnd = view.end.clone().stripZone(); // normalize timezone
 		var normalRanges = this.eventsToNormalRanges(events); // will give us normalized dates we can use w/o copies
@@ -619,7 +618,6 @@ $.extend(Grid.prototype, {
 	// Slices the given event range into one or more segment objects.
 	// A `rangeToSegsFunc` custom slicing function can be given.
 	eventRangeToSegs: function(eventRange, rangeToSegsFunc) {
-		var event = eventRange.event;
 		var segs;
 		var i, seg;
 
@@ -632,7 +630,7 @@ $.extend(Grid.prototype, {
 
 		for (i = 0; i < segs.length; i++) {
 			seg = segs[i];
-			seg.event = event;
+			seg.event = eventRange.event;
 			seg.eventStartMS = eventRange.eventStartMS;
 			seg.eventDurationMS = eventRange.eventDurationMS;
 		}

+ 1 - 1
src/common/TimeGrid.js

@@ -434,7 +434,7 @@ $.extend(TimeGrid.prototype, {
 		var segEls;
 		var j;
 
-		if (!segs.length) return;
+		if (!segs.length) { return; }
 
 		segCols = this.groupSegCols(segs); // group into sub-arrays, and assigns 'col' to each seg
 

+ 1 - 1
tests/automated/eventMouseover.js

@@ -23,7 +23,7 @@ describe('eventMouseover', function() {
 				options.eventMouseover = function(event, ev) {
 					expect(typeof event).toBe('object');
 					expect(typeof ev).toBe('object');
-					event.title = "YO";
+					event.title = 'YO';
 					$('#cal').fullCalendar('updateEvent', event);
 				};
 				options.eventMouseout = function(event, ev) {