mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 12:39:25 +01:00
Add attribute class to tab elements in order to be able to distinguish between tab's DOM
This commit is contained in:
parent
2f6c66c600
commit
fe83235b1d
@ -111,17 +111,24 @@ var et2_tabbox = et2_valueWidget.extend([et2_IInput,et2_IResizeable],
|
|||||||
{
|
{
|
||||||
var index_name = et2_readAttrWithDefault(node, "id");
|
var index_name = et2_readAttrWithDefault(node, "id");
|
||||||
var hide = false;
|
var hide = false;
|
||||||
|
var widget_options = {};
|
||||||
if(index_name) {
|
if(index_name) {
|
||||||
if(selected == index_name) this.selected_index = i;
|
if(selected == index_name) this.selected_index = i;
|
||||||
if(hidden[index_name]) {
|
if(hidden[index_name]) {
|
||||||
hide = true;
|
hide = true;
|
||||||
}
|
}
|
||||||
|
// Get the class attribute and add it as widget_options
|
||||||
|
var classAttr = et2_readAttrWithDefault(node,"class");
|
||||||
|
if (classAttr)
|
||||||
|
{
|
||||||
|
widget_options = {'class':classAttr};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
tabData.push({
|
tabData.push({
|
||||||
"id": index_name,
|
"id": index_name,
|
||||||
"label": this.egw().lang(et2_readAttrWithDefault(node, "label", "Tab")),
|
"label": this.egw().lang(et2_readAttrWithDefault(node, "label", "Tab")),
|
||||||
"widget": null,
|
"widget": null,
|
||||||
"widget_options": {},
|
"widget_options": widget_options,
|
||||||
"contentDiv": null,
|
"contentDiv": null,
|
||||||
"flagDiv": null,
|
"flagDiv": null,
|
||||||
"hidden": hide,
|
"hidden": hide,
|
||||||
@ -314,6 +321,11 @@ var et2_tabbox = et2_valueWidget.extend([et2_IInput,et2_IResizeable],
|
|||||||
entry.flagDiv = $j(document.createElement("span"))
|
entry.flagDiv = $j(document.createElement("span"))
|
||||||
.addClass("et2_tabflag")
|
.addClass("et2_tabflag")
|
||||||
.appendTo(this.flagContainer);
|
.appendTo(this.flagContainer);
|
||||||
|
// Class to tab's div container
|
||||||
|
if (entry.widget_options && typeof entry.widget_options.class != 'undefined')
|
||||||
|
{
|
||||||
|
entry.flagDiv.addClass(entry.widget_options.class);
|
||||||
|
}
|
||||||
entry.flagDiv.text(entry.label || "Tab");
|
entry.flagDiv.text(entry.label || "Tab");
|
||||||
if(entry.hidden)
|
if(entry.hidden)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user