- 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); this._super.apply(this, arguments);
// Avoid many problems with home // 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 // Re-init sidebox, since it was probably initialized too soon
var sidebox = jQuery('#favorite_sidebox_'+this.appname); 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]; day = this.day_widgets[i];
// Classes // 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'); day.set_class('calendar_differentMonth');
} }
@ -1349,34 +1350,26 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view.
this.set_end_date(day_list[day_list.length-1]); 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 // Sub widgets actually get their own data from egw.data, so we'll
if(this.isAttached()) // stick it there
var consolidated = et2_calendar_view.is_consolidated(this.options.owner, this.day_list.length == 1 ? 'day' : 'week');
for(var day in events)
{ {
// Sub widgets actually get their own data from egw.data, so we'll var day_list = [];
// stick it there for(var i = 0; i < events[day].length; i++)
var consolidated = et2_calendar_view.is_consolidated(this.options.owner, this.day_list.length == 1 ? 'day' : 'week');
for(var day in events)
{ {
var day_list = []; day_list.push(events[day][i].row_id);
for(var i = 0; i < events[day].length; i++) egw.dataStoreUID('calendar::'+events[day][i].row_id, events[day][i]);
{ }
day_list.push(events[day][i].row_id); // Might be split by user, so we have to check that too
egw.dataStoreUID('calendar::'+events[day][i].row_id, events[day][i]); for(var i = 0; i < this.options.owner.length; i++)
} {
// Might be split by user, so we have to check that too var owner = consolidated ? this.options.owner : this.options.owner[i];
for(var i = 0; i < this.options.owner.length; i++) var day_id = app.classes.calendar._daywise_cache_id(day,owner);
{ egw.dataStoreUID(day_id, day_list);
var owner = consolidated ? this.options.owner : this.options.owner[i]; if(consolidated) break;
var day_id = app.classes.calendar._daywise_cache_id(day,owner);
egw.dataStoreUID(day_id, day_list);
if(consolidated) break;
}
} }
}
else
{
this.value = events;
} }
} }
@ -1429,7 +1422,9 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view.
this.owner.set_value(''); this.owner.set_value('');
if(this.options.start_date) 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 else