ccdb7b4ffd
This patch overrides a Bootstrap's default property that disables mouse events on elements with .form-control-feedback class. The password icon had pointer-events: none; affecting password reveal functionality in login form and Identity->Users->Create User. It also modifies the default cursor for the password icon with pointer. This patch also fixes a bug where the Eye Icon is misaligned when passwords don't match (See #1604196) Change-Id: I052321a5cc9adc1a7ffdfce4da0b55c245481a2d Closes-bug: #1593430 Closes-bug: #1604196
32 lines
934 B
JavaScript
32 lines
934 B
JavaScript
horizon.user = {
|
|
|
|
init: function() {
|
|
$("#id_password").change(function () {
|
|
if ($("#id_confirm_password").val() !== "") {
|
|
horizon.user.check_passwords_match();
|
|
}
|
|
});
|
|
|
|
$("#id_confirm_password").change(function () {
|
|
horizon.user.check_passwords_match();
|
|
});
|
|
},
|
|
|
|
check_passwords_match: function() {
|
|
var row = $("input#id_confirm_password");
|
|
var error_id = "id_confirm_password_error";
|
|
var msg = "<span id='" + error_id + "' class='help-block'>" + gettext("Passwords do not match.") + "</span>";
|
|
|
|
var password = $("#id_password").val();
|
|
var confirm_password = $("#id_confirm_password").val();
|
|
|
|
if (password !== confirm_password && $("#" + error_id).length === 0) {
|
|
$(row).parent().addClass("has-error").append(msg);
|
|
} else if (password === confirm_password) {
|
|
$(row).parent().removeClass("has-error");
|
|
$("#" + error_id).remove();
|
|
}
|
|
}
|
|
};
|
|
|