Added ability for restricting the jquery context when the request is made

This commit is contained in:
Andreas Stöckel 2010-06-18 14:23:51 +00:00
parent b94e897717
commit 262460ac0c

View File

@ -125,11 +125,15 @@ var egw_json_files = {};
* @param string _menuaction the menuaction function which should be called and which handles the actual request
* @param array _parameters which should be passed to the menuaction function.
*/
function egw_json_request(_menuaction, _parameters)
function egw_json_request(_menuaction, _parameters, _context)
{
//Copy the supplied parameters
this.menuaction = _menuaction;
this.context = window.document;
if (typeof _context != 'undefined')
this.context = _context;
if (typeof _parameters != 'undefined')
{
this.parameters = _parameters;
@ -275,7 +279,7 @@ egw_json_request.prototype.handleResponse = function(data, textStatus, XMLHttpRe
{
try
{
var jQueryObject = $(res.data.select);
var jQueryObject = $(res.data.select, this.context);
jQueryObject[res.data.func].apply(jQueryObject, res.data.parms);
}
catch (e)