mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-22 07:30:23 +00:00
Update js-toggle-password w/ fontawesome glyphs
This commit is contained in:
parent
4850354630
commit
162dbf74e0
1 changed files with 3 additions and 3 deletions
|
@ -480,18 +480,18 @@ Array.range = (start, end) => Array.from({length: (end - start)}, (v, k) => k +
|
|||
$(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())
|
||||
$("i", this).removeClass("fas fa-eye").addClass(button.attr("data-toggle-with"));
|
||||
}
|
||||
|
||||
if (field.attr("type") === "password") {
|
||||
button.text(button.data("toggle-with"));
|
||||
field.attr("type", "text");
|
||||
} else {
|
||||
button.text(button.data("__toggle-with-initial"));
|
||||
$("i", this).removeClass("fas fa-eye-slash").addClass("fas fa-eye");
|
||||
field.attr("type", "password");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue