egw.getCache(name) function to get a cache-object shared between all EGroupware windows and popups

used to share server-side generated options for et2_selectbox
also removed nextmatch specific code from et2_selectbox which seems no longer necessary
This commit is contained in:
Ralf Becker
2021-07-19 16:57:25 +02:00
parent cc27253b7b
commit 0a1e784f2e
2 changed files with 29 additions and 31 deletions

View File

@ -145,9 +145,27 @@ egw.extend('utils', egw.MODULE_GLOBAL, function()
var uid_counter = 0;
/**
* Global cache shared between all EGroupware windows
* @type {{}}
*/
const cache = {};
// Create the utils object which contains references to all functions
// covered by it.
var utils = {
/**
* Get a cache object shared between all EGroupware windows
*
* @param {string} _name unique name for the cache-object
* @return {*}
*/
getCache: function(_name)
{
if (typeof cache[_name] === 'undefined') cache[_name] = {};
return cache[_name];
},
ajaxUrl: function(_menuaction) {
if(_menuaction.indexOf('menuaction=') >= 0)