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>
(cherry picked from commit 34c06b4704
)
This commit is contained in:
parent
9964141082
commit
0c556476f0
1 changed files with 1 additions and 1 deletions
|
@ -55,7 +55,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();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue