Revert commit d95a6f82ab as it breaks calendar loading

This commit is contained in:
Hadi Nategh 2016-06-23 17:38:32 +02:00
parent 1fab6876c4
commit 5551832c4d
2 changed files with 10 additions and 40 deletions

View File

@ -2023,16 +2023,6 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend(
*/ */
if(grid) if(grid)
{ {
// Show loading div to hide redrawing
egw.loading_prompt(
this.appname,true,egw.lang('please wait...'),
typeof framework !== 'undefined' ? framework.applications.calendar.tab.contentDiv : false,
egwIsMobile()?'horizental':'spinner'
);
var loading = false;
var value = []; var value = [];
state.state.first = view.start_date(state.state).toJSON(); state.state.first = view.start_date(state.state).toJSON();
// We'll modify this one, so it needs to be a new object // We'll modify this one, so it needs to be a new object
@ -2106,11 +2096,11 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend(
owner: state.state.owner[i] owner: state.state.owner[i]
}); });
} }
loading = this._need_data(day_value,state.state); this._need_data(day_value,state.state);
} }
else else
{ {
loading = this._need_data(value,state.state); this._need_data(value,state.state);
} }
var row_index = 0; var row_index = 0;
@ -2236,7 +2226,7 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend(
} }
} }
var value = [{start_date: state.state.first, end_date: state.state.last}]; var value = [{start_date: state.state.first, end_date: state.state.last}];
loading = this._need_data(value,state.state); this._need_data(value,state.state);
} }
// Include first & last dates in state, mostly for server side processing // Include first & last dates in state, mostly for server side processing
if(state.state.first && state.state.first.toJSON) state.state.first = state.state.first.toJSON(); if(state.state.first && state.state.first.toJSON) state.state.first = state.state.first.toJSON();
@ -2280,6 +2270,13 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend(
},this,et2_calendar_timegrid); },this,et2_calendar_timegrid);
} }
// Trigger resize to get correct sizes, as they may have sized while
// hidden
for(var i = 0; i < view.etemplates.length; i++)
{
view.etemplates[i].resize();
}
// List view (nextmatch) has slightly different fields // List view (nextmatch) has slightly different fields
if(state.state.view === 'listview') if(state.state.view === 'listview')
{ {
@ -2418,23 +2415,6 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend(
} }
egw.set_preference('calendar','saved_states', save); egw.set_preference('calendar','saved_states', save);
// Trigger resize to get correct sizes, as they may have sized while
// hidden
for(var i = 0; i < view.etemplates.length; i++)
{
view.etemplates[i].resize();
}
// If we need to fetch data from the server, it will hide the loader
// when done but if everything is in the cache, hide from here.
if(!loading)
{
window.setTimeout(jQuery.proxy(function() {
egw.loading_prompt(this.appname,false);
},this),500);
}
return; return;
} }
// old calendar state handling on server-side (incl. switching to and from listview) // old calendar state handling on server-side (incl. switching to and from listview)
@ -2671,8 +2651,6 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend(
* *
* @param {Object} value * @param {Object} value
* @param {Object} state * @param {Object} state
*
* @return {boolean} Data was requested
*/ */
_need_data: function(value, state) _need_data: function(value, state)
{ {
@ -2750,8 +2728,6 @@ app.classes.calendar = (function(){ "use strict"; return AppJS.extend(
this.sidebox_et2 ? null : this.et2.getInstanceManager() this.sidebox_et2 ? null : this.et2.getInstanceManager()
); );
} }
return need_data;
}, },
/** /**

View File

@ -767,10 +767,6 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view.
* We use a timeout to avoid doing it multiple times if redrawing or resizing. * We use a timeout to avoid doing it multiple times if redrawing or resizing.
*/ */
resizeTimes: function() { resizeTimes: function() {
// Hide resizing from user
this.loader.show();
// Wait a bit to see if anything else changes, then re-draw the times // Wait a bit to see if anything else changes, then re-draw the times
if(this.resize_timer) if(this.resize_timer)
{ {
@ -828,8 +824,6 @@ var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view.
child.resize(); child.resize();
},this, et2_IResizeable); },this, et2_IResizeable);
} }
this.loader.hide();
}, },
/** /**