Skip to content

Commit 3f364f5

Browse files
committed
modules now loaded directly when page gets rendered
1 parent 76fd8fd commit 3f364f5

File tree

7 files changed

+25
-17
lines changed

7 files changed

+25
-17
lines changed

form-validator/date.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
*
1414
* @license Dual licensed under the MIT or GPL Version 2 licenses
15-
* @version 1.9.26
15+
* @version 1.9.27
1616
*/
1717
(function($) {
1818

form-validator/jquery.form-validator.js

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Documentation and issue tracking on Github <https://github.com/victorjonsson/jQuery-Form-Validator/>
66
*
77
* @license Dual licensed under the MIT or GPL Version 2 licenses
8-
* @version 1.9.26
8+
* @version 1.9.27
99
*/
1010
(function($) {
1111

@@ -536,26 +536,34 @@
536536
});
537537
};
538538

539-
if(typeof path != 'undefined')
539+
if( path ) {
540540
loadModuleScripts(modules, path);
541-
else {
542-
$(function() {
541+
} else {
542+
var findScriptPathAndLoadModules = function() {
543+
var foundPath = false;
543544
$('script').each(function() {
544545
var src = $(this).attr('src');
545546
if( src ) {
546547
var scriptName = src.substr(src.lastIndexOf('/')+1, src.length);
547548
if(scriptName.indexOf('jquery.form-validator.js') > -1 || scriptName.indexOf('jquery.form-validator.min.js') > -1) {
548-
path = src.substr(0, src.lastIndexOf('/')) + '/';
549-
if(path == '/')
550-
path = '';
551-
549+
foundPath = src.substr(0, src.lastIndexOf('/')) + '/';
550+
if( foundPath == '/' )
551+
foundPath = '';
552552
return false;
553553
}
554554
}
555555
});
556556

557-
loadModuleScripts(modules, path);
558-
});
557+
if( foundPath !== false) {
558+
loadModuleScripts(modules, foundPath);
559+
return true;
560+
}
561+
return false;
562+
};
563+
564+
if( !findScriptPathAndLoadModules() ) {
565+
$(findScriptPathAndLoadModules);
566+
}
559567
}
560568
},
561569

form-validator/jquery.form-validator.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

form-validator/location.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* @license Dual licensed under the MIT or GPL Version 2 licenses
14-
* @version 1.9.26
14+
* @version 1.9.27
1515
*/
1616
(function($) {
1717

form-validator/security.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* - validate_backend
1313
*
1414
* @license Dual licensed under the MIT or GPL Version 2 licenses
15-
* @version 1.9.26
15+
* @version 1.9.27
1616
*/
1717
(function($) {
1818

form-validator/sweden.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* - validate_swephone
1414
*
1515
* @license Dual licensed under the MIT or GPL Version 2 licenses
16-
* @version 1.9.26
16+
* @version 1.9.27
1717
*/
1818
(function($) {
1919

form-validator/uk.dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* - validate_ukvatnumber
1010
*
1111
* @license Dual licensed under the MIT or GPL Version 2 licenses
12-
* @version 1.9.26
12+
* @version 1.9.27
1313
*/
1414
$.formUtils.addValidator({
1515
name : 'validate_ukvatnumber',

0 commit comments

Comments
 (0)