diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-04-28 23:33:24 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-05-02 23:53:02 +0200 |
commit | 34c06b4704383428c87e0a3c3c96ff7facfa5c46 (patch) | |
tree | 2a0b39fec23a5ca5837d438a16480030f1cbc503 /modules | |
parent | 80fdf82add1598262ddb1858f45e7e6adacb5c41 (diff) |
luci-mod-system: password.js: make event handler attachment more robust
Do not expect a specific markup structure but use querySelector() to locate
the input element.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules')
-rw-r--r-- | modules/luci-mod-system/htdocs/luci-static/resources/view/system/password.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/password.js b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/password.js index f3275606c..eb9d4a6d7 100644 --- a/modules/luci-mod-system/htdocs/luci-static/resources/view/system/password.js +++ b/modules/luci-mod-system/htdocs/luci-static/resources/view/system/password.js @@ -57,7 +57,7 @@ return view.extend({ o.renderWidget = function(/* ... */) { var node = form.Value.prototype.renderWidget.apply(this, arguments); - node.childNodes[1].addEventListener('keydown', function(ev) { + node.querySelector('input').addEventListener('keydown', function(ev) { if (ev.keyCode == 13 && !ev.currentTarget.classList.contains('cbi-input-invalid')) document.querySelector('.cbi-button-save').click(); }); |