Load javascript files before processing other response types, so all JS is available.

This commit is contained in:
Nathan Gray 2013-07-20 13:41:17 +00:00
parent 23fa7ed233
commit 26e9792256

View File

@ -95,6 +95,22 @@ egw.extend('json', egw.MODULE_WND_LOCAL, function(_app, _wnd) {
json_request.prototype.handleResponse = function(data) {
if (data && data.response)
{
// Load files first
var js_files = [];
for (var i = data.response.length - 1; i > 0; --i)
{
var res = data.response[i];
if(res.type == 'js' && typeof res.data == 'string')
{
js_files.unshift(res.data);
data.response.splice(i,1);
}
}
if(js_files.length > 0)
{
this.egw.includeJS(js_files, function() {this.handleResponse(data);}, this);
return;
}
for (var i = 0; i < data.response.length; i++)
{
// Get the response object