mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
replaced CheckPSK dom level 1 events with level 2 event listener-driven implementation
This commit is contained in:
13
js/custom.js
13
js/custom.js
@@ -213,6 +213,19 @@ $(document).on("click", ".js-toggle-password", function(e) {
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on("keyup", ".js-validate-psk", function(e) {
|
||||
var field = $(e.target);
|
||||
var colors = field.data("colors").split(",");
|
||||
var target = $(field.data("target"));
|
||||
if (field.val().length < 8 || field.val().length > 63) {
|
||||
field.css("backgroundColor", colors[0]);
|
||||
target.attr("disabled", true);
|
||||
} else {
|
||||
field.css("backgroundColor", colors[1]);
|
||||
target.attr("disabled", false);
|
||||
}
|
||||
});
|
||||
|
||||
$(document)
|
||||
.ajaxSend(setCSRFTokenHeader)
|
||||
.ready(contentLoaded)
|
||||
|
Reference in New Issue
Block a user