Преглед изворни кода

reimplement rerenderEvents

Adam Shaw пре 8 година
родитељ
комит
f70a038b9f
3 измењених фајлова са 10 додато и 2 уклоњено
  1. 1 1
      src/Calendar.js
  2. 1 1
      src/Calendar.options.js
  3. 8 0
      src/View.js

+ 1 - 1
src/Calendar.js

@@ -295,7 +295,7 @@ var Calendar = FC.Calendar = Class.extend(EmitterMixin, {
 
 	rerenderEvents: function() { // API method. destroys old events if previously rendered.
 		if (this.elementVisible()) {
-			this.view.flash('displayingEvents');
+			this.view.rerenderEvents();
 		}
 	},
 

+ 1 - 1
src/Calendar.options.js

@@ -69,7 +69,7 @@ Calendar.mixin({
 				return; // optionsModel already reacts to this
 			}
 			else if (optionName === 'timezone') {
-				this.view.flash('initialEvents');
+				this.view.flash('initialEvents'); // refetches and reprocesses events
 				return;
 			}
 		}

+ 8 - 0
src/View.js

@@ -495,6 +495,14 @@ var View = FC.View = InteractiveDateComponent.extend({
 	},
 
 
+	rerenderEvents: function() {
+		if (this.has('currentEvents')) {
+			// re-transmit events to this DateComponent, which will forward on the events to children as well.
+			this.handleEventsReset(this.get('currentEvents'));
+		}
+	},
+
+
 	// Event Rendering Triggers
 	// -----------------------------------------------------------------------------------------------------------------