diff --git a/Gruntfile.js b/Gruntfile.js index a65926596..0a4789c73 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -594,19 +594,24 @@ module.exports = function(grunt) { replace: { npm: { options: { + preserveOrder: true, patterns: [ { match: /\$\.fn\.\w+\s*=\s*function\(parameters\)\s*{/g, replacement: 'module.exports = function(parameters) {\n var _module = module;\n' }, { - match: /\$\.fn\.\w+\.settings/g, - replacement: '_module.exports.settings' + match: /\$\.fn\.\w+\s*=\s*function\(fields, parameters\)\s*{/g, + replacement: 'module.exports = function(fields, parameters) {\n var _module = module;\n' }, { match: /\$\.fn\.\w+\.settings\s*=/g, replacement: 'module.exports.settings =' }, + { + match: /\$\.fn\.\w+\.settings/g, + replacement: '_module.exports.settings' + }, { match: /jQuery/g, replacement: 'require("jquery")' diff --git a/npm/modules/behavior/form.js b/npm/modules/behavior/form.js index 34700f4c9..32cf71df7 100644 --- a/npm/modules/behavior/form.js +++ b/npm/modules/behavior/form.js @@ -11,7 +11,9 @@ ;(function ( $, window, document, undefined ) { -$.fn.form = function(fields, parameters) { +module.exports = function(fields, parameters) { + var _module = module; + var $allModules = $(this),