mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-23 07:09:20 +01:00
Add new method etemplate2.getById() to get etemplate object by DOM ID of container node
This commit is contained in:
parent
4110056a3e
commit
a1ae0bdb83
@ -783,6 +783,30 @@ etemplate2.getByApplication = function(app)
|
||||
return list;
|
||||
};
|
||||
|
||||
/**
|
||||
* Get a etemplate2 object from the given DOM ID
|
||||
*
|
||||
* @param {string} id DOM ID of the container node
|
||||
* @returns {etemplate2|null}
|
||||
*/
|
||||
etemplate2.getById = function(id)
|
||||
{
|
||||
for( var name in etemplate2._byTemplate)
|
||||
{
|
||||
console.log(name, etemplate2._byTemplate[name]);
|
||||
for(var i = 0; i < etemplate2._byTemplate[name].length; i++)
|
||||
{
|
||||
var et = etemplate2._byTemplate[name][i];
|
||||
|
||||
if(et.DOMContainer.getAttribute("id") == id)
|
||||
{
|
||||
return et;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Plugin for egw.json type "et2_load"
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user