luci: Make password reveal work with passsword managers
authorAndrew Dodd <[email protected]>
Tue, 17 Dec 2024 01:37:35 +0000 (12:37 +1100)
committerPaul Donald <[email protected]>
Fri, 21 Mar 2025 13:57:31 +0000 (14:57 +0100)
commitfc8ad20bbb7d7df16aeda37e8c3bf8495bedc6c3
tree2d2ed5690e5c1905b4837a800a211ecccba8a24b
parent51a8f8cd229cb95deb607422a43d570d2d90980e
luci: Make password reveal work with passsword managers

Password managers (like LastPass etc) tend to add additional elements
into the DOM for their own context menus. If this happens between the
hide/reveal button and the password input, then the logic to reveal the
password breaks.

This change updates the onclick handler to look for the first `<input>`
element with the class `password-input` that is under the parent of the
toggle button, and then to toggle the password/text type on that
element.

This change deliberately only updates the main ui.js file, not any
application files.

Signed-off-by: Andrew Dodd <[email protected]>
modules/luci-base/htdocs/luci-static/resources/ui.js