Przeglądaj źródła

make sure rendering from setElement+setDate have only one updateSize

Adam Shaw 8 lat temu
rodzic
commit
3af33035c8
1 zmienionych plików z 5 dodań i 0 usunięć
  1. 5 0
      src/Calendar.ts

+ 5 - 0
src/Calendar.ts

@@ -487,6 +487,7 @@ export default class Calendar {
 
 			this.bindViewHandlers(newView);
 
+			newView.startBatchRender(); // so that setElement+setDate rendering are joined
 			newView.setElement(
 				$("<div class='fc-view fc-" + viewType + "-view' />").appendTo(this.contentEl)
 			);
@@ -502,6 +503,10 @@ export default class Calendar {
 			}
 
 			this.view.setDate(this.currentDate);
+
+			if (newView) {
+				newView.stopBatchRender();
+			}
 		}
 
 		this.thawContentHeight();