Explorar o código

fix issue 2203

Adam Shaw %!s(int64=11) %!d(string=hai) anos
pai
achega
c275ec4928
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      src/EventManager.js

+ 7 - 1
src/EventManager.js

@@ -267,6 +267,7 @@ function EventManager(options) { // assumed to be a calendar
 
 			// for array sources, we convert to standard Event Objects up front
 			if ($.isArray(source.events)) {
+				source.origArray = source.events; // for removeEventSource
 				source.events = $.map(source.events, function(eventInput) {
 					return buildEvent(eventInput, source);
 				});
@@ -299,7 +300,12 @@ function EventManager(options) { // assumed to be a calendar
 
 
 	function getSourcePrimitive(source) {
-		return ((typeof source == 'object') ? (source.events || source.url) : '') || source;
+		return (
+			(typeof source === 'object') ? // a normalized event source?
+				(source.origArray || source.url || source.events) : // get the primitive
+				null
+		) ||
+		source; // the given argument *is* the primitive
 	}