Browse Source

Patch over pull request #1156 to solve an issue with the form behavior

With this fix one needs to explicitely define:
$.fn.form = require('semantic-ui/npm/modules/behavior/form');
pull/1194/head
Davide Marqus 10 years ago
parent
commit
f5777c1ccc
2 changed files with 10 additions and 3 deletions
  1. 9
      Gruntfile.js
  2. 4
      npm/modules/behavior/form.js

9
Gruntfile.js

@ -594,19 +594,24 @@ module.exports = function(grunt) {
replace: { replace: {
npm: { npm: {
options: { options: {
preserveOrder: true,
patterns: [ patterns: [
{ {
match: /\$\.fn\.\w+\s*=\s*function\(parameters\)\s*{/g, match: /\$\.fn\.\w+\s*=\s*function\(parameters\)\s*{/g,
replacement: 'module.exports = function(parameters) {\n var _module = module;\n' 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, match: /\$\.fn\.\w+\.settings\s*=/g,
replacement: 'module.exports.settings =' replacement: 'module.exports.settings ='
}, },
{
match: /\$\.fn\.\w+\.settings/g,
replacement: '_module.exports.settings'
},
{ {
match: /jQuery/g, match: /jQuery/g,
replacement: 'require("jquery")' replacement: 'require("jquery")'

4
npm/modules/behavior/form.js

@ -11,7 +11,9 @@
;(function ( $, window, document, undefined ) { ;(function ( $, window, document, undefined ) {
$.fn.form = function(fields, parameters) {
module.exports = function(fields, parameters) {
var _module = module;
var var
$allModules = $(this), $allModules = $(this),

Loading…
Cancel
Save