mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
improved password toggle
This commit is contained in:
20
js/custom.js
20
js/custom.js
@@ -193,6 +193,26 @@ function loadWifiStations(refresh) {
|
||||
|
||||
$(".js-reload-wifi-stations").on("click", loadWifiStations(true));
|
||||
|
||||
$(document).on("click", ".js-toggle-password", function(e) {
|
||||
var button = $(e.target)
|
||||
var field = $(button.data("target"));
|
||||
if (field.is(":input")) {
|
||||
e.preventDefault();
|
||||
|
||||
if (!button.data("__toggle-with-initial")) {
|
||||
button.data("__toggle-with-initial", button.text())
|
||||
}
|
||||
|
||||
if (field.attr("type") === "password") {
|
||||
button.text(button.data("toggle-with"));
|
||||
field.attr("type", "text");
|
||||
} else {
|
||||
button.text(button.data("__toggle-with-initial"));
|
||||
field.attr("type", "password");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document)
|
||||
.ajaxSend(setCSRFTokenHeader)
|
||||
.ready(contentLoaded)
|
||||
|
Reference in New Issue
Block a user