mirror of
https://github.com/jquery-validation/jquery-validation.git
synced 2025-12-20 09:11:40 +01:00
Core: Explicit default for focusCleanup option
Also removes unused blockFocusCleanup property check. Fixes #676
This commit is contained in:
@@ -229,6 +229,7 @@ $.extend( $.validator, {
|
|||||||
errorClass: "error",
|
errorClass: "error",
|
||||||
validClass: "valid",
|
validClass: "valid",
|
||||||
errorElement: "label",
|
errorElement: "label",
|
||||||
|
focusCleanup: false,
|
||||||
focusInvalid: true,
|
focusInvalid: true,
|
||||||
errorContainer: $( [] ),
|
errorContainer: $( [] ),
|
||||||
errorLabelContainer: $( [] ),
|
errorLabelContainer: $( [] ),
|
||||||
@@ -238,8 +239,8 @@ $.extend( $.validator, {
|
|||||||
onfocusin: function( element ) {
|
onfocusin: function( element ) {
|
||||||
this.lastActive = element;
|
this.lastActive = element;
|
||||||
|
|
||||||
// hide error label and remove error class on focus if enabled
|
// Hide error label and remove error class on focus if enabled
|
||||||
if ( this.settings.focusCleanup && !this.blockFocusCleanup ) {
|
if ( this.settings.focusCleanup ) {
|
||||||
if ( this.settings.unhighlight ) {
|
if ( this.settings.unhighlight ) {
|
||||||
this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass );
|
this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass );
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user