Explorar el Código

separate upateSize from render

Adam Shaw hace 7 años
padre
commit
8f81e4fae4
Se han modificado 1 ficheros con 7 adiciones y 3 borrados
  1. 7 3
      src/Calendar.ts

+ 7 - 3
src/Calendar.ts

@@ -131,9 +131,8 @@ export default class Calendar {
       this.el.classList.add('fc')
       this._render()
     } else if (this.elementVisible()) {
-      // mainly for the public API
       this.calcSize()
-      this.updateViewSize(true) // force=true
+      this.requestRerender(true)
     }
   }
 
@@ -477,7 +476,7 @@ export default class Calendar {
     this.handleOptions(this.optionsManager.computed)
 
     if (name === 'height' || name === 'contentHeight' || name === 'aspectRatio') {
-      this.updateViewSize(true) // isResize=true
+      this.updateSize()
     } else if (name === 'timeZone') {
       this.dispatch({
         type: 'CHANGE_TIMEZONE',
@@ -841,6 +840,11 @@ export default class Calendar {
   // -----------------------------------------------------------------------------------------------------------------
 
 
+  updateSize() { // public
+    this.updateViewSize(true) // force=true
+  }
+
+
   getSuggestedViewHeight(): number {
     if (this.suggestedViewHeight == null) {
       this.calcSize()