diff options
author | Jo-Philipp Wich <jo@mein.io> | 2019-06-06 20:49:19 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2019-07-07 15:36:25 +0200 |
commit | 4a0f8b55415b48d2d28475f3844558691ea891c5 (patch) | |
tree | 93055772f32328107c81d08a6b677a3770ec034f /modules/luci-base | |
parent | 2f79aa1c357932c9c573703da2dddf555b2e2e4d (diff) |
luci-base: ui.js: fix rendering of rich dropdown placeholders
Placeholders may be HTML elements instead of plain strings, so do
not use innerHTML to assign them but rely on L.dom.content() instead.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base')
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/ui.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/ui.js b/modules/luci-base/htdocs/luci-static/resources/ui.js index 3370d225cd..c51d651e9e 100644 --- a/modules/luci-base/htdocs/luci-static/resources/ui.js +++ b/modules/luci-base/htdocs/luci-static/resources/ui.js @@ -477,8 +477,8 @@ var UIDropdown = UIElement.extend({ else sb.removeAttribute('empty'); - more.innerHTML = (ndisplay == this.options.display_items) - ? (this.options.select_placeholder || this.options.placeholder) : '···'; + L.dom.content(more, (ndisplay == this.options.display_items) + ? (this.options.select_placeholder || this.options.placeholder) : '···'); sb.addEventListener('click', this.handleClick.bind(this)); @@ -715,8 +715,8 @@ var UIDropdown = UIElement.extend({ else sb.removeAttribute('empty'); - more.innerHTML = (ndisplay === this.options.display_items) - ? (this.options.select_placeholder || this.options.placeholder) : '···'; + L.dom.content(more, (ndisplay === this.options.display_items) + ? (this.options.select_placeholder || this.options.placeholder) : '···'); } else { var sel = li.parentNode.querySelector('[selected]'); |