summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs/luci-static/resources/ui.js
diff options
context:
space:
mode:
authorFlorian Eckert <fe@dev.tdt.de>2021-01-14 18:04:02 +0100
committerGitHub <noreply@github.com>2021-01-14 18:04:02 +0100
commit4f3934172cd6fff4fdf9709331cd87cffadffc8b (patch)
tree127c4765cb65317f69191aaab1decff498256612 /modules/luci-base/htdocs/luci-static/resources/ui.js
parentab9de0784f2162e93a2fc54933a076b887ba861a (diff)
parentab390cf94eef0fa0d5278073e5fffaecb9722f82 (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.js16
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);
},