diff --git a/calendar/js/app.js b/calendar/js/app.js index 724a39a94a..d20db8bbcd 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -2252,6 +2252,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 89987ccfb1..967326dfa2 100644 --- a/calendar/js/et2_widget_timegrid.js +++ b/calendar/js/et2_widget_timegrid.js @@ -934,22 +934,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) @@ -999,6 +990,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 *