diff options
author | Florian Eckert <fe@dev.tdt.de> | 2021-01-14 18:04:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-14 18:04:02 +0100 |
commit | 4f3934172cd6fff4fdf9709331cd87cffadffc8b (patch) | |
tree | 127c4765cb65317f69191aaab1decff498256612 /modules/luci-base/htdocs/luci-static/resources/ui.js | |
parent | ab9de0784f2162e93a2fc54933a076b887ba861a (diff) | |
parent | ab390cf94eef0fa0d5278073e5fffaecb9722f82 (diff) |
Merge pull request #4667 from TDT-AG/pr/20201218-luci-base-tooltip
luci-base: add generic tooltip handling
Diffstat (limited to 'modules/luci-base/htdocs/luci-static/resources/ui.js')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/ui.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/ui.js b/modules/luci-base/htdocs/luci-static/resources/ui.js index e35a26a8ba..3ada9e375a 100644 --- a/modules/luci-base/htdocs/luci-static/resources/ui.js +++ b/modules/luci-base/htdocs/luci-static/resources/ui.js @@ -610,6 +610,22 @@ var UICheckbox = UIElement.extend(/** @lends LuCI.ui.Checkbox.prototype */ { frameEl.appendChild(E('label', { 'for': id })); + if (this.options.tooltip != null) { + var icon = "⚠️"; + + if (this.options.tooltipicon != null) + icon = this.options.tooltipicon; + + frameEl.appendChild( + E('label', { 'class': 'cbi-tooltip-container' },[ + icon, + E('div', { 'class': 'cbi-tooltip' }, + this.options.tooltip + ) + ]) + ); + } + return this.bind(frameEl); }, |