mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Update js-toggle-password w/ fontawesome glyphs
This commit is contained in:
parent
4850354630
commit
162dbf74e0
@ -480,18 +480,18 @@ Array.range = (start, end) => Array.from({length: (end - start)}, (v, k) => k +
|
|||||||
$(document).on("click", ".js-toggle-password", function(e) {
|
$(document).on("click", ".js-toggle-password", function(e) {
|
||||||
var button = $(e.target)
|
var button = $(e.target)
|
||||||
var field = $(button.data("target"));
|
var field = $(button.data("target"));
|
||||||
|
|
||||||
if (field.is(":input")) {
|
if (field.is(":input")) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
if (!button.data("__toggle-with-initial")) {
|
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") {
|
if (field.attr("type") === "password") {
|
||||||
button.text(button.data("toggle-with"));
|
|
||||||
field.attr("type", "text");
|
field.attr("type", "text");
|
||||||
} else {
|
} else {
|
||||||
button.text(button.data("__toggle-with-initial"));
|
$("i", this).removeClass("fas fa-eye-slash").addClass("fas fa-eye");
|
||||||
field.attr("type", "password");
|
field.attr("type", "password");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user