Skip to content

Commit 1b4b10b

Browse files
committed
Improve module loader to avoid to perform useless polling to server
1 parent c9ad2a9 commit 1b4b10b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "jquery-forms-validator",
33
"description": "With this feature rich jQuery plugin it becomes easy to validate user input while keeping your HTML markup clean from javascript code. Even though this plugin has a wide range of validation functions it's designed to require as little bandwidth as possible. This is achieved by grouping together validation functions in \"modules\", making it possible for the programmer to load only those functions that's needed to validate a particular form.",
4-
"version": "2.3.83",
4+
"version": "2.3.84",
55
"main": "./form-validator/jquery.form-validator.min.js",
66
"keywords": [
77
"form",

src/main/module-loader.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@
2929
* @return {Boolean}
3030
*/
3131
hasLoadedModule: function (name) {
32-
return $.trim(name).toLowerCase() in this.loadedModules;
32+
var moduleName = $.trim(name).toLowerCase();
33+
var hasModule = moduleName in this.loadedModules;
34+
if (!hasModule){
35+
hasModule = moduleName.slice(0, -3) in this.loadedModules;
36+
}
37+
return hasModule;
3338
},
3439

3540
/**

0 commit comments

Comments
 (0)