Fix problem while reloading store
authorMichael Spahn <m.spahn@metaways.de>
Thu, 11 Dec 2014 17:17:41 +0000 (18:17 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 25 Feb 2015 16:15:20 +0000 (17:15 +0100)
The whole day events are now resized after store reload

Change-Id: Ibaa92cfcdf10f4ca12c7da030c97fa43b56d009a

tine20/Calendar/js/CalendarPanelSplitPlugin.js

index 66b3ded..db28fd0 100644 (file)
@@ -48,6 +48,7 @@ Tine.Calendar.CalendarPanelSplitPlugin.prototype = {
         }, this);
         this.calPanel.on('afterlayout', function() {
             this.calPanel.body.setWidth(this.calPanel.getWidth());
         }, this);
         this.calPanel.on('afterlayout', function() {
             this.calPanel.body.setWidth(this.calPanel.getWidth());
+            this.resizeWholeDayArea.defer(this.attendeeViews.items.length * 120, this, [true]);;
         }, this);
         
         this.mainStore = this.calPanel.view.store;
         }, this);
         
         this.mainStore = this.calPanel.view.store;
@@ -214,12 +215,14 @@ Tine.Calendar.CalendarPanelSplitPlugin.prototype = {
                     //assert position
                     this.calPanel.items.remove(attendeeView.ownerCt);
                     this.calPanel.items.insert(idx, attendeeView.ownerCt);
                     //assert position
                     this.calPanel.items.remove(attendeeView.ownerCt);
                     this.calPanel.items.insert(idx, attendeeView.ownerCt);
-                    
+
                     var filterFn = attendeeView.store.filterFn;
                     attendeeView.initData(this.cloneStore(filterFn));
                     attendeeView.onLoad();
                 }
             }, this);
                     var filterFn = attendeeView.store.filterFn;
                     attendeeView.initData(this.cloneStore(filterFn));
                     attendeeView.onLoad();
                 }
             }, this);
+
+            this.resizeWholeDayArea.defer(this.attendeeViews.items.length * 120, this, [true]);
         }
     },
     
         }
     },
     
@@ -328,12 +331,25 @@ Tine.Calendar.CalendarPanelSplitPlugin.prototype = {
     resizeWholeDayArea: function(onupdate) {
         if (this.attendeeViews.items.length > 1) {
             var maxWholeDayAreaSize = 10;
     resizeWholeDayArea: function(onupdate) {
         if (this.attendeeViews.items.length > 1) {
             var maxWholeDayAreaSize = 10;
+            var scrollerSize = this.getActiveView().scroller.getHeight();
             this.attendeeViews.each(function(view) {
                 if (onupdate) {
             this.attendeeViews.each(function(view) {
                 if (onupdate) {
-                    view.heightIsCalculated = false;
+                    view.wholeDayArea.heightIsCalculated = false;
+                }
+                if (view.wholeDayArea.children.length > 1
+                    && ((view.wholeDayArea.hasOwnProperty('heightIsCalculated')
+                    && view.wholeDayArea.heightIsCalculated == false)
+                    || (! view.wholeDayArea.hasOwnProperty('heightIsCalculated'))))
+                {
+                    if (parseInt(view.wholeDayArea.clientHeight) > maxWholeDayAreaSize) {
+                        maxWholeDayAreaSize = view.wholeDayArea.clientHeight;
+                        scrollerSize = view.scroller.getHeight();
+                    }
                 }
                 }
-                if (view.wholeDayArea.children.length > 1  && ((view.wholeDayArea.hasOwnProperty('heightIsCalculated') && view.wholeDayArea.heightIsCalculated == false) || (! view.wholeDayArea.hasOwnProperty('heightIsCalculated')))) {
-                    maxWholeDayAreaSize = (parseInt(view.wholeDayArea.clientHeight) > maxWholeDayAreaSize) ? view.wholeDayArea.clientHeight : maxWholeDayAreaSize;
+
+                if (parseInt(view.wholeDayArea.clientHeight) > maxWholeDayAreaSize) {
+                    maxWholeDayAreaSize = view.wholeDayArea.clientHeight;
+                    scrollerSize = this.container.getSize(true);
                 }
             });
             this.attendeeViews.each(function(view) {
                 }
             });
             this.attendeeViews.each(function(view) {
@@ -345,6 +361,11 @@ Tine.Calendar.CalendarPanelSplitPlugin.prototype = {
                     view.wholeDayArea.heightIsCalculated = false;
                 }
                 Ext.fly(view.wholeDayScroller).setHeight(maxWholeDayAreaSize);
                     view.wholeDayArea.heightIsCalculated = false;
                 }
                 Ext.fly(view.wholeDayScroller).setHeight(maxWholeDayAreaSize);
+
+                var hdHeight = this.mainHd.getHeight();
+                var vh = this.container.getSize(true).height - (hdHeight);
+
+                Ext.fly(view.scroller).setHeight(vh);
             });
         }
     },
             });
         }
     },