compose-form-up
Advanced tools
Comparing version 1.9.4 to 1.9.5
@@ -22,3 +22,3 @@ var toolbox = require( 'compose-toolbox' ), | ||
// If diffs already contains this label, do not add it. | ||
if ( !diffs.find( d => d.label == diff.label ) ) diffs.push( diff ) | ||
if ( !diffs.find( function(d) { return d.label == diff.label } ) ) diffs.push( diff ) | ||
}) | ||
@@ -41,3 +41,3 @@ | ||
toolbox.each( elementsToToggle, el => { | ||
toolbox.each( elementsToToggle, function( el) { | ||
el.classList.toggle( 'form-diff-hidden', diffEl.children.length == 0 ) | ||
@@ -82,3 +82,3 @@ }) | ||
toolbox.each( form.querySelectorAll( Selector ), ( el, index ) => { | ||
toolbox.each( form.querySelectorAll( Selector ), function ( el, index ) { | ||
el.dataset.formDiffId = `form-diff-${randID()}-${index}` | ||
@@ -125,3 +125,3 @@ }) | ||
toolbox.each( inputs, input => { | ||
toolbox.each( inputs, function ( input ) { | ||
@@ -137,3 +137,3 @@ if ( input.type == 'range' && input.dataset.values ) { | ||
var options = {} | ||
toolbox.each(input.children, o => { | ||
toolbox.each(input.children, function ( o ) { | ||
options[o.value] = o.value ? o.text : 'no selection' | ||
@@ -153,3 +153,3 @@ }) | ||
radioInputs.forEach( radio => { | ||
radioInputs.forEach( function( radio ) { | ||
if ( radio.dataset.initialValue == 'true' ) radioInitial = getLabel.text( radio ) | ||
@@ -179,3 +179,3 @@ if ( radio.checked ) diff.value.push( getLabel.text( radio ) ) | ||
diff.name = diff.name.join(' ') | ||
diff.selector = diff.selector.map( s => `[data-form-diff-id="${s}"]` ).join(', ') | ||
diff.selector = diff.selector.map( function ( s ) { return `[data-form-diff-id="${s}"]` } ).join(', ') | ||
@@ -187,3 +187,3 @@ return diff | ||
function watch () { | ||
Event.change(()=> { | ||
Event.change( function() { | ||
inputChange.watch() | ||
@@ -190,0 +190,0 @@ Event.on( document, 'change', 'form', Event.debounce( diffForm, 100 ) ) |
@@ -30,9 +30,9 @@ var toolbox = require( 'compose-toolbox' ) | ||
// | ||
var selector = labelledBy.split(' ').map( name => '#'+name ) | ||
var selector = labelledBy.split(' ').map( function ( name ) { return '#'+name } ) | ||
var labelText = Array.prototype.map.call( selector, s => { | ||
var labelText = Array.prototype.map.call( selector, function( s ) { | ||
var el = document.querySelector( s ) | ||
if ( el ) return el.textContent | ||
else return false | ||
}).filter( e => e != false ) | ||
}).filter( function ( e ) { return e != false } ) | ||
@@ -39,0 +39,0 @@ if ( labelText ) label = labelText.join(' ') |
@@ -39,3 +39,3 @@ var toolbox = require( 'compose-toolbox' ), | ||
if ( form ) { | ||
return Array.prototype.forEach.call( form.querySelectorAll( `[name='${input.name}']` ), e => { | ||
return Array.prototype.forEach.call( form.querySelectorAll( `[name='${input.name}']` ), function ( e ) { | ||
changeClasses( e, true ) | ||
@@ -62,3 +62,3 @@ }) | ||
// Remove all defaulted value classnames on an input change | ||
toolbox.each( label.querySelectorAll( '.defaulted-value' ), el => el.classList.remove( 'defaulted-value' ) ) | ||
toolbox.each( label.querySelectorAll( '.defaulted-value' ), function ( el ) { el.classList.remove( 'defaulted-value' ) } ) | ||
label.classList.remove( 'input-defaulted-value' ) | ||
@@ -65,0 +65,0 @@ } |
@@ -10,3 +10,3 @@ var Event = require( 'compose-event' ), | ||
toolbox.each( inputs, i => { | ||
toolbox.each( inputs, function ( i ) { | ||
setValue( i, i.dataset.initialValue ) | ||
@@ -32,3 +32,3 @@ }) | ||
toolbox.each( targets, el => { | ||
toolbox.each( targets, function ( el ) { | ||
@@ -35,0 +35,0 @@ // Restore to default a single element |
{ | ||
"name": "compose-form-up", | ||
"version": "1.9.4", | ||
"version": "1.9.5", | ||
"description": "A lightweight HTML5 form utility including validation, progressive forms, and other handy tools.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
220668