Skip to content

Commit 0eccc71

Browse files
committed
AC-8077::Upgrade JQuery Validation Plugin library to the latest version
1 parent 37b3978 commit 0eccc71

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

lib/web/jquery/jquery.validate.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99
(function( factory ) {
1010
if ( typeof define === "function" && define.amd ) {
11-
define( ["jquery"], factory );
11+
define( ["jquery", "jquery/jquery.metadata"], factory );
1212
} else if (typeof module === "object" && module.exports) {
1313
module.exports = factory( require( "jquery" ) );
1414
} else {
@@ -192,6 +192,7 @@
192192
data = $.validator.normalizeRules(
193193
$.extend(
194194
{},
195+
$.validator.metadataRules(element),
195196
$.validator.classRules( element ),
196197
$.validator.attributeRules( element ),
197198
$.validator.dataRules( element ),
@@ -782,7 +783,7 @@
782783
normalizer = this.settings.normalizer;
783784
}
784785

785-
// If normalizer is defined, then call it to the changed value instead
786+
// If normalizer is defined, then call it to retreive the changed value instead
786787
// of using the real one.
787788
// Note that `this` in the normalizer is `element`.
788789
if ( normalizer ) {
@@ -1038,7 +1039,7 @@
10381039
// 'aria-describedby' should directly reference the error element
10391040
if ( describer ) {
10401041
selector = selector + ", #" + this.escapeCssMeta( describer )
1041-
.replace( /\s+/g, ", #" );
1042+
.replace( /\s+/g, ", #" ) + ":visible";
10421043
}
10431044

10441045
return this
@@ -1240,6 +1241,17 @@
12401241
}
12411242
},
12421243

1244+
metadataRules: function (element) {
1245+
if (!$.metadata) {
1246+
return {};
1247+
}
1248+
1249+
var meta = $.data(element.form, 'validator').settings.meta;
1250+
return meta ?
1251+
$(element).metadata()[meta] :
1252+
$(element).metadata();
1253+
},
1254+
12431255
attributeRules: function( element ) {
12441256
var rules = {},
12451257
$element = $( element ),

0 commit comments

Comments
 (0)