mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-02 20:19:27 +01:00
we must not make json_request object global as it interferes with registered plugins from different windows
Example was tracker site config opened in an iframe, then stopped further et2_load responses to the main window because it still used window object from the iframe and therefore could not find the node
This commit is contained in:
parent
5a209a00f0
commit
45758aaada
@ -4,7 +4,7 @@
|
||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||
* @package etemplate
|
||||
* @subpackage api
|
||||
* @link http://www.egroupware.org
|
||||
* @link https://www.egroupware.org
|
||||
* @author Andreas Stöckel (as AT stylite.de)
|
||||
* @author Ralf Becker <RalfBecker@outdoor-training.de>
|
||||
*/
|
||||
@ -59,7 +59,7 @@ egw.extend('json', egw.MODULE_WND_LOCAL, function(_app, _wnd)
|
||||
* @param {object} _sender
|
||||
* @param {egw} _egw
|
||||
*/
|
||||
window.json_request = function(_menuaction, _parameters, _callback, _context,
|
||||
const json_request = function(_menuaction, _parameters, _callback, _context,
|
||||
_async, _sender, _egw)
|
||||
{
|
||||
// Copy the parameters
|
||||
@ -105,7 +105,7 @@ egw.extend('json', egw.MODULE_WND_LOCAL, function(_app, _wnd)
|
||||
* @param {function} error option error callback(_msg) used instead our default this.error
|
||||
* @param {int} reconnect timeout in ms (internal)
|
||||
*/
|
||||
window.json_request.prototype.openWebSocket = function(url, tokens, account_id, error, reconnect)
|
||||
json_request.prototype.openWebSocket = function(url, tokens, account_id, error, reconnect)
|
||||
{
|
||||
const min_reconnect_time = 1000;
|
||||
const max_reconnect_time = 300000;
|
||||
@ -193,7 +193,7 @@ egw.extend('json', egw.MODULE_WND_LOCAL, function(_app, _wnd)
|
||||
*
|
||||
* @return {jqXHR|boolean} jQuery jqXHR request object or for async==="keepalive" boolean is returned
|
||||
*/
|
||||
window.json_request.prototype.sendRequest = function(async, method, error)
|
||||
json_request.prototype.sendRequest = function(async, method, error)
|
||||
{
|
||||
if(typeof async != "undefined")
|
||||
{
|
||||
@ -244,7 +244,7 @@ egw.extend('json', egw.MODULE_WND_LOCAL, function(_app, _wnd)
|
||||
* @param {XMLHTTP} _xmlhttp
|
||||
* @param {string} _err
|
||||
*/
|
||||
window.json_request.prototype.handleError = function(_xmlhttp, _err) {
|
||||
json_request.prototype.handleError = function(_xmlhttp, _err) {
|
||||
// Don't error about an abort
|
||||
if(_err !== 'abort')
|
||||
{
|
||||
@ -271,7 +271,7 @@ egw.extend('json', egw.MODULE_WND_LOCAL, function(_app, _wnd)
|
||||
}
|
||||
};
|
||||
|
||||
window.json_request.prototype.handleResponse = function(data) {
|
||||
json_request.prototype.handleResponse = function(data) {
|
||||
if (data && typeof data.response != 'undefined')
|
||||
{
|
||||
if (egw.preference('show_generation_time', 'common', false) == "1")
|
||||
|
Loading…
Reference in New Issue
Block a user