瀏覽代碼

separate upateSize from render

Adam Shaw 7 年之前
父節點
當前提交
8f81e4fae4
共有 1 個文件被更改,包括 7 次插入3 次删除
  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.el.classList.add('fc')
       this._render()
       this._render()
     } else if (this.elementVisible()) {
     } else if (this.elementVisible()) {
-      // mainly for the public API
       this.calcSize()
       this.calcSize()
-      this.updateViewSize(true) // force=true
+      this.requestRerender(true)
     }
     }
   }
   }
 
 
@@ -477,7 +476,7 @@ export default class Calendar {
     this.handleOptions(this.optionsManager.computed)
     this.handleOptions(this.optionsManager.computed)
 
 
     if (name === 'height' || name === 'contentHeight' || name === 'aspectRatio') {
     if (name === 'height' || name === 'contentHeight' || name === 'aspectRatio') {
-      this.updateViewSize(true) // isResize=true
+      this.updateSize()
     } else if (name === 'timeZone') {
     } else if (name === 'timeZone') {
       this.dispatch({
       this.dispatch({
         type: 'CHANGE_TIMEZONE',
         type: 'CHANGE_TIMEZONE',
@@ -841,6 +840,11 @@ export default class Calendar {
   // -----------------------------------------------------------------------------------------------------------------
   // -----------------------------------------------------------------------------------------------------------------
 
 
 
 
+  updateSize() { // public
+    this.updateViewSize(true) // force=true
+  }
+
+
   getSuggestedViewHeight(): number {
   getSuggestedViewHeight(): number {
     if (this.suggestedViewHeight == null) {
     if (this.suggestedViewHeight == null) {
       this.calcSize()
       this.calcSize()