mirror of
https://github.com/openwrt/luci.git
synced 2026-04-15 19:01:56 +00:00
luci-base: actions title for actions buttons group
Customizable title. Signed-off-by: Paul Donald <newtwen+github@gmail.com>
This commit is contained in:
@@ -2474,6 +2474,15 @@ const CBITableSection = CBITypedSection.extend(/** @lends LuCI.form.TableSection
|
||||
* @default null
|
||||
*/
|
||||
|
||||
/**
|
||||
* Set a custom text for the actions column header row when actions buttons
|
||||
* are present.
|
||||
*
|
||||
* @name LuCI.form.TableSection.prototype#actionstitle
|
||||
* @type string|function
|
||||
* @default null
|
||||
*/
|
||||
|
||||
/**
|
||||
* Specify a maximum amount of columns to display. By default, one table
|
||||
* column is rendered for each child option of the form section element.
|
||||
@@ -2715,10 +2724,13 @@ const CBITableSection = CBITypedSection.extend(/** @lends LuCI.form.TableSection
|
||||
dom.content(trEl.lastElementChild, opt.title);
|
||||
}
|
||||
|
||||
if (this.sortable || this.extedit || this.addremove || has_more || has_action || this.cloneable)
|
||||
if (this.sortable || this.extedit || this.addremove || has_more || has_action || this.cloneable) {
|
||||
const rawTitle = (this.actionstitle !== undefined) ? this.actionstitle : null;
|
||||
const actionsTitle = (typeof rawTitle === 'function') ? rawTitle.call(this, has_action) : rawTitle;
|
||||
trEl.appendChild(E('th', {
|
||||
'class': 'th cbi-section-table-cell cbi-section-actions'
|
||||
}));
|
||||
}, (actionsTitle !== undefined) ? actionsTitle : null));
|
||||
}
|
||||
|
||||
trEls.appendChild(trEl);
|
||||
}
|
||||
@@ -2742,10 +2754,13 @@ const CBITableSection = CBITypedSection.extend(/** @lends LuCI.form.TableSection
|
||||
(typeof(opt.width) == 'number') ? `${opt.width}px` : opt.width;
|
||||
}
|
||||
|
||||
if (this.sortable || this.extedit || this.addremove || has_more || has_action || this.cloneable)
|
||||
if (this.sortable || this.extedit || this.addremove || has_more || has_action || this.cloneable) {
|
||||
const rawTitle = (this.actionstitle !== undefined) ? this.actionstitle : null;
|
||||
const actionsTitle = (typeof rawTitle === 'function') ? rawTitle.call(this, has_action) : rawTitle;
|
||||
trEl.appendChild(E('th', {
|
||||
'class': 'th cbi-section-table-cell cbi-section-actions'
|
||||
}));
|
||||
}, (actionsTitle !== undefined) ? actionsTitle : null));
|
||||
}
|
||||
|
||||
trEls.appendChild(trEl);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user