mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-05 04:49:44 +01:00
Fixed hypothetical problem with certain entries not being updated properly on app instances of egw
This commit is contained in:
parent
1c386e2d6b
commit
04db17f9e5
@ -81,6 +81,48 @@ if (typeof Array.prototype.indexOf == "undefined")
|
|||||||
|
|
||||||
var localEgw = {};
|
var localEgw = {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The egw function returns an instance of the client side api. If no
|
||||||
|
* parameter is given, an egw istance, which is not bound to a certain
|
||||||
|
* application is returned.
|
||||||
|
*/
|
||||||
|
egw = function(_app) {
|
||||||
|
|
||||||
|
// If no argument is given, simply return the global egw object, or
|
||||||
|
// check whether 'window.egw_appName' is set correctly.
|
||||||
|
if (typeof _app === 'undefined')
|
||||||
|
{
|
||||||
|
// TODO: Remove this code, window.egw_appName will be removed
|
||||||
|
// in the future.
|
||||||
|
if (typeof window.egw_appName == 'string')
|
||||||
|
{
|
||||||
|
_app = window.egw_appName;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return egw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof _app == 'string')
|
||||||
|
{
|
||||||
|
// If a argument is given, this represents the current application
|
||||||
|
// name. Check whether we already have a copy of the egw object for
|
||||||
|
// that application. If yes, return it.
|
||||||
|
if (typeof localEgw[_app] === 'undefined')
|
||||||
|
{
|
||||||
|
// Otherwise clone the global egw object, set the application
|
||||||
|
// name and return it
|
||||||
|
localEgw[_app] = cloneObject(egw);
|
||||||
|
localEgw[_app].appName = _app;
|
||||||
|
}
|
||||||
|
|
||||||
|
return localEgw[_app];
|
||||||
|
}
|
||||||
|
|
||||||
|
this.debug("error", "Non-string argument given to the egw function.");
|
||||||
|
}
|
||||||
|
|
||||||
var globalEgw = {
|
var globalEgw = {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -129,10 +171,6 @@ if (typeof Array.prototype.indexOf == "undefined")
|
|||||||
// nothing but an object containing the extension.
|
// nothing but an object containing the extension.
|
||||||
var content = _code.call(this);
|
var content = _code.call(this);
|
||||||
|
|
||||||
// Merge the extension into the global egw object (used for
|
|
||||||
// cloning)
|
|
||||||
mergeObjects(globalEgw, content);
|
|
||||||
|
|
||||||
// Merge the extension into the egw function
|
// Merge the extension into the egw function
|
||||||
mergeObjects(egw, content);
|
mergeObjects(egw, content);
|
||||||
|
|
||||||
@ -189,48 +227,6 @@ if (typeof Array.prototype.indexOf == "undefined")
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* The egw function returns an instance of the client side api. If no
|
|
||||||
* parameter is given, an egw istance, which is not bound to a certain
|
|
||||||
* application is returned.
|
|
||||||
*/
|
|
||||||
egw = function(_app) {
|
|
||||||
|
|
||||||
// If no argument is given, simply return the global egw object, or
|
|
||||||
// check whether 'window.egw_appName' is set correctly.
|
|
||||||
if (typeof _app === 'undefined')
|
|
||||||
{
|
|
||||||
// TODO: Remove this code, window.egw_appName will be removed
|
|
||||||
// in the future.
|
|
||||||
if (typeof window.egw_appName == 'string')
|
|
||||||
{
|
|
||||||
_app = window.egw_appName;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return egw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof _app == 'string')
|
|
||||||
{
|
|
||||||
// If a argument is given, this represents the current application
|
|
||||||
// name. Check whether we already have a copy of the egw object for
|
|
||||||
// that application. If yes, return it.
|
|
||||||
if (typeof localEgw[_app] === 'undefined')
|
|
||||||
{
|
|
||||||
// Otherwise clone the global egw object, set the application
|
|
||||||
// name and return it
|
|
||||||
localEgw[_app] = cloneObject(globalEgw);
|
|
||||||
localEgw[_app].appName = _app;
|
|
||||||
}
|
|
||||||
|
|
||||||
return localEgw[_app];
|
|
||||||
}
|
|
||||||
|
|
||||||
this.debug("error", "Non-string argument given to the egw function.");
|
|
||||||
}
|
|
||||||
|
|
||||||
mergeObjects(egw, globalEgw);
|
mergeObjects(egw, globalEgw);
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
Loading…
Reference in New Issue
Block a user