diff --git a/calendar/js/app.js b/calendar/js/app.js index 7c4e28c695..8038e506dc 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -2254,6 +2254,7 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend( // Do not need to re-set this row, but we do need to re-do // the times, as they may have changed widget.resizeTimes(); + window.setTimeout(jQuery.proxy(widget.set_header_classes, widget),0); // Hide loader widget.loader.hide(); diff --git a/calendar/js/et2_widget_timegrid.js b/calendar/js/et2_widget_timegrid.js index 67e4e3550d..c166a487ec 100644 --- a/calendar/js/et2_widget_timegrid.js +++ b/calendar/js/et2_widget_timegrid.js @@ -935,22 +935,13 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view. this.day_widgets.splice(delete_index--,1); } + this.set_header_classes(); + // Create / update day widgets with dates and data for(var i = 0; i < this.day_widgets.length; i++) { day = this.day_widgets[i]; - // Classes - if(app.calendar && app.calendar.state && - this.day_list[i] && parseInt(this.day_list[i].substr(4,2)) !== new Date(app.calendar.state.date).getUTCMonth()+1) - { - day.set_class('calendar_differentMonth'); - } - else - { - day.set_class(''); - } - // Position day.set_left((day_width * i) + 'px'); if(this.daily_owner) @@ -1000,6 +991,30 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view. */ }, + /** + * Set header classes + * + */ + set_header_classes: function() + { + var day; + for(var i = 0; i < this.day_widgets.length; i++) + { + day = this.day_widgets[i]; + + // Classes + if(app.calendar && app.calendar.state && + this.day_list[i] && parseInt(this.day_list[i].substr(4,2)) !== new Date(app.calendar.state.date).getUTCMonth()+1) + { + day.set_class('calendar_differentMonth'); + } + else + { + day.set_class(''); + } + } + }, + /** * Update UI while scrolling within the selected time *