luci-mod-system: submit password change on enter
authorJo-Philipp Wich <jo@mein.io>
Tue, 20 Nov 2018 10:54:22 +0000 (11:54 +0100)
committerJo-Philipp Wich <jo@mein.io>
Tue, 20 Nov 2018 10:54:22 +0000 (11:54 +0100)
Allow to submit the password change form by pressing enter in the second
input field.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-mod-system/luasrc/view/admin_system/password.htm

index 3aff9c981cf0abd10fe4d847b477779a802dd2aa..db35fb01e8e958e470b05919ce04b06989a28584 100644 (file)
@@ -56,7 +56,7 @@
                <div class="cbi-value">
                        <label class="cbi-value-title" for="image"><%:Confirmation%></label>
                        <div class="cbi-value-field">
-                               <input type="password" name="pw2" /><!--
+                               <input type="password" name="pw2" onkeydown="if (event.keyCode === 13) submitPassword(event)" /><!--
                                --><button class="cbi-button cbi-button-neutral" title="<%:Reveal/hide password%>" aria-label="<%:Reveal/hide password%>" onclick="var e = this.previousElementSibling; e.type = (e.type === 'password') ? 'text' : 'password'">∗</button>
                        </div>
                </div>