From b408d9fa1d4b67f64360a46d2070bf3510b63944 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Wed, 4 May 2016 16:45:42 +0000 Subject: [PATCH] Stop day view resize while hidden - it gets the size wrong. Another attempt, preventing events from resizing incorrectly --- calendar/js/app.js | 25 +++++++++++-------------- calendar/js/et2_widget_daycol.js | 4 ---- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/calendar/js/app.js b/calendar/js/app.js index 99029a0363..50f6dbd884 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -2197,24 +2197,21 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend( if(state.state.last && state.state.last.toJSON) state.state.last = state.state.last.toJSON(); // Toggle todos - if(state.state.view == 'day' || this.state.view == 'day') + if((state.state.view == 'day' || this.state.view == 'day') && $j(view.etemplates[0].DOMContainer).is(':visible')) { if(state.state.view == 'day' && state.state.owner.length === 1 && !isNaN(state.state.owner) && state.state.owner[0] >= 0 && !egwIsMobile()) { - if($j(view.etemplates[0].DOMContainer).is(':visible')) - { - view.etemplates[0].widgetContainer.iterateOver(function(w) { - w.set_width($j(view.etemplates[0].DOMContainer).width() * 0.69); - },this,et2_calendar_timegrid); + view.etemplates[0].widgetContainer.iterateOver(function(w) { + w.set_width($j(view.etemplates[0].DOMContainer).width() * 0.69); + },this,et2_calendar_timegrid); - $j(view.etemplates[1].DOMContainer).css({"left":"69%", "height":($j(framework.tabsUi.activeTab.contentDiv).height()-30)+'px'}); - // TODO: Maybe some caching here - this.egw.jsonq('calendar_uiviews::ajax_get_todos', [state.state.date, state.state.owner[0]], function(data) { - this.getWidgetById('label').set_value(data.label||''); - this.getWidgetById('todos').set_value({content:data.todos||''}); - },view.etemplates[1].widgetContainer); - view.etemplates[0].resize(); - } + $j(view.etemplates[1].DOMContainer).css({"left":"69%", "height":($j(framework.tabsUi.activeTab.contentDiv).height()-30)+'px'}); + // TODO: Maybe some caching here + this.egw.jsonq('calendar_uiviews::ajax_get_todos', [state.state.date, state.state.owner[0]], function(data) { + this.getWidgetById('label').set_value(data.label||''); + this.getWidgetById('todos').set_value({content:data.todos||''}); + },view.etemplates[1].widgetContainer); + view.etemplates[0].resize(); } else { diff --git a/calendar/js/et2_widget_daycol.js b/calendar/js/et2_widget_daycol.js index be9735f48f..87f600cc87 100644 --- a/calendar/js/et2_widget_daycol.js +++ b/calendar/js/et2_widget_daycol.js @@ -857,10 +857,6 @@ var et2_calendar_daycol = (function(){ "use strict"; return et2_valueWidget.exte */ position_event: function(event) { - // Not visible? Skip it for speed. - // Should be called again as part of resize when shown. - if(!this.div.is(':visible')) return; - // Sort events into minimally-overlapping columns var columns = this._spread_events();