Skip to content

Commit bb129ff

Browse files
roysanchezryanbrandenburg
authored andcommitted
Added AMD support and removed jquery-ready call to unobtrusive.parse
1 parent 8b1a0d6 commit bb129ff

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

dist/jquery.validate.unobtrusive.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@
55
/*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */
66
/*global document: false, jQuery: false */
77

8-
(function ($) {
8+
(function( factory ) {
9+
if ( typeof define === "function" && define.amd ) {
10+
define( ["jquery", "jquery.validate"], factory );
11+
} else {
12+
factory( jQuery );
13+
}
14+
}(function ($) {
915
var $jQval = $.validator,
1016
adapters,
1117
data_validation = "unobtrusiveValidation";
@@ -408,8 +414,6 @@
408414
setValidationValues(options, "regex", options.params.regex);
409415
}
410416
});
411-
412-
$(function () {
413-
$jQval.unobtrusive.parse(document);
414-
});
415-
}(jQuery));
417+
418+
return $jQval.unobtrusive;
419+
}));

0 commit comments

Comments
 (0)