forked from extern/egroupware
allow to optional prepend tabs by using prepend attribute on a tab in tabs array
This commit is contained in:
parent
ee97185b40
commit
46d4d3acce
@ -29,7 +29,7 @@ var et2_tabbox = et2_valueWidget.extend([et2_IInput],
|
||||
'tabs': {
|
||||
'name': 'Tabs',
|
||||
'default': et2_no_init,
|
||||
'description': "Array of [extra] tabs. Each tab needs {label:..., template:...}. Additional optional keys are hidden and id, for access into content array"
|
||||
'description': "Array of [extra] tabs. Each tab needs {label:..., template:...}. Additional optional keys are prepend, hidden and id, for access into content array"
|
||||
},
|
||||
'add_tabs': {
|
||||
'name': 'Add tabs',
|
||||
@ -193,7 +193,7 @@ var et2_tabbox = et2_valueWidget.extend([et2_IInput],
|
||||
{
|
||||
tab_options.content = tab.id;
|
||||
}
|
||||
tabData.push({
|
||||
tabData[tab.prepend ? 'unshift' : 'push'].call(tabData, {
|
||||
"id": tab.id,
|
||||
"label": this.egw().lang(tab.label),
|
||||
"widget": null,
|
||||
@ -248,6 +248,9 @@ var et2_tabbox = et2_valueWidget.extend([et2_IInput],
|
||||
|
||||
/**
|
||||
* Load & render a tab's content
|
||||
*
|
||||
* @param {number} index numerical index of tab in this.tabData array
|
||||
* @param {array} promises
|
||||
*/
|
||||
_loadTab: function(index,promises) {
|
||||
var tabData = this.tabData[index];
|
||||
@ -273,6 +276,8 @@ var et2_tabbox = et2_valueWidget.extend([et2_IInput],
|
||||
|
||||
/**
|
||||
* Check for custom tabs
|
||||
*
|
||||
* @param {object} _attrs
|
||||
*/
|
||||
transformAttributes: function(_attrs) {
|
||||
this._super.apply(this, arguments);
|
||||
|
Loading…
Reference in New Issue
Block a user