- Fix loading overlay on home was not removed

- Fix missing initial data on home
This commit is contained in:
Nathan Gray 2016-04-06 22:23:43 +00:00
parent 559eb432f0
commit ef6f689121
2 changed files with 27 additions and 28 deletions

View File

@ -149,7 +149,11 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend(
this._super.apply(this, arguments);
// Avoid many problems with home
if(_et2.app !== 'calendar') return;
if(_et2.app !== 'calendar')
{
egw.loading_prompt(this.appname,false);
return;
}
// Re-init sidebox, since it was probably initialized too soon
var sidebox = jQuery('#favorite_sidebox_'+this.appname);

View File

@ -899,7 +899,8 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view.
day = this.day_widgets[i];
// Classes
if(this.day_list[i] && parseInt(this.day_list[i].substr(4,2)) !== new Date(app.calendar.state.date).getUTCMonth()+1)
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');
}
@ -1349,10 +1350,7 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view.
this.set_end_date(day_list[day_list.length-1]);
}
// We need to check if we're attached already, as the datastore can cause
// conflicts across other events (especially home) if we call it too early
if(this.isAttached())
{
// Sub widgets actually get their own data from egw.data, so we'll
// stick it there
var consolidated = et2_calendar_view.is_consolidated(this.options.owner, this.day_list.length == 1 ? 'day' : 'week');
@ -1374,11 +1372,6 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view.
}
}
}
else
{
this.value = events;
}
}
// Reset and calculate instead of just use the keys so we can get the weekend preference
this.day_list = [];
@ -1429,7 +1422,9 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view.
this.owner.set_value('');
if(this.options.start_date)
{
this.set_label(egw.lang('wk') + ' ' +app.calendar.date.week_number(this.options.start_date));
this.set_label(egw.lang('wk') + ' ' +
(app.calendar ? app.calendar.date.week_number(this.options.start_date) : '')
);
}
}
else