Adam Shaw 7 lat temu
rodzic
commit
bd0649c1a1
4 zmienionych plików z 12 dodań i 11 usunięć
  1. 1 0
      src/Calendar.ts
  2. 7 9
      src/CalendarComponent.ts
  3. 1 1
      src/Toolbar.ts
  4. 3 1
      src/reducers/eventSources.ts

+ 1 - 0
src/Calendar.ts

@@ -338,6 +338,7 @@ export default class Calendar {
     if (needsFull || !component) {
     if (needsFull || !component) {
 
 
       if (component) {
       if (component) {
+        component.freezeHeight() // next component will unfreeze it
         component.destroy()
         component.destroy()
       }
       }
 
 

+ 7 - 9
src/CalendarComponent.ts

@@ -99,14 +99,14 @@ export default class CalendarComponent extends Component<CalendarComponentProps>
   }
   }
 
 
   render(props: CalendarComponentProps) {
   render(props: CalendarComponentProps) {
-    this.freezeContentHeight()
+    this.freezeHeight()
 
 
     let title = this.computeTitle(props.dateProfile, props.viewSpec.options)
     let title = this.computeTitle(props.dateProfile, props.viewSpec.options)
     this.subrender('renderToolbars', [ props.viewSpec, props.dateProfile, props.dateProfileGenerator, title ])
     this.subrender('renderToolbars', [ props.viewSpec, props.dateProfile, props.dateProfileGenerator, title ])
     this.renderView(props, title)
     this.renderView(props, title)
 
 
     this.updateRootSize()
     this.updateRootSize()
-    this.thawContentHeight()
+    this.thawHeight()
   }
   }
 
 
   renderToolbars(viewSpec: ViewSpec, dateProfile: DateProfile, dateProfileGenerator: DateProfileGenerator, title: string) {
   renderToolbars(viewSpec: ViewSpec, dateProfile: DateProfile, dateProfileGenerator: DateProfileGenerator, title: string) {
@@ -260,17 +260,15 @@ export default class CalendarComponent extends Component<CalendarComponentProps>
   // Height "Freezing"
   // Height "Freezing"
   // -----------------------------------------------------------------------------------------------------------------
   // -----------------------------------------------------------------------------------------------------------------
 
 
-  freezeContentHeight() {
-    applyStyle(this.contentEl, {
-      width: '100%',
-      height: this.contentEl.offsetHeight,
+  freezeHeight() {
+    applyStyle(this.el, {
+      height: this.el.offsetHeight,
       overflow: 'hidden'
       overflow: 'hidden'
     })
     })
   }
   }
 
 
-  thawContentHeight() {
-    applyStyle(this.contentEl, {
-      width: '',
+  thawHeight() {
+    applyStyle(this.el, {
       height: '',
       height: '',
       overflow: ''
       overflow: ''
     })
     })

+ 1 - 1
src/Toolbar.ts

@@ -271,7 +271,7 @@ export default class Toolbar extends Component<ToolbarRenderProps> {
   updateActiveButton(buttonName?) {
   updateActiveButton(buttonName?) {
     let className = this.theme.getClass('stateActive')
     let className = this.theme.getClass('stateActive')
 
 
-    findElements(this.el, '.fc-button').forEach((buttonEl) => {
+    findElements(this.el, 'button').forEach((buttonEl) => { // fyi, themed buttons don't have .fc-button
       if (buttonName && buttonEl.classList.contains('fc-' + buttonName + '-button')) {
       if (buttonName && buttonEl.classList.contains('fc-' + buttonName + '-button')) {
         buttonEl.classList.add(className)
         buttonEl.classList.add(className)
       } else {
       } else {

+ 3 - 1
src/reducers/eventSources.ts

@@ -15,8 +15,10 @@ export default function(eventSources: EventSourceHash, action: Action, dateProfi
     case 'REMOVE_EVENT_SOURCE':
     case 'REMOVE_EVENT_SOURCE':
       return removeSource(eventSources, action.sourceId)
       return removeSource(eventSources, action.sourceId)
 
 
+    case 'SET_VIEW_TYPE':
+    case 'SET_DATE':
     case 'SET_DATE_PROFILE':
     case 'SET_DATE_PROFILE':
-      return fetchDirtySources(eventSources, action.dateProfile.activeRange, calendar)
+      return fetchDirtySources(eventSources, dateProfile.activeRange, calendar)
 
 
     case 'FETCH_EVENT_SOURCES':
     case 'FETCH_EVENT_SOURCES':
     case 'CHANGE_TIMEZONE':
     case 'CHANGE_TIMEZONE':