diff --git a/src/strand-checkbox/strand-checkbox.js b/src/strand-checkbox/strand-checkbox.js index 6256f878..26b03fcf 100644 --- a/src/strand-checkbox/strand-checkbox.js +++ b/src/strand-checkbox/strand-checkbox.js @@ -80,7 +80,7 @@ _stateChanged: function(newVal, oldVal) { this.debounce("stateChecked", this._handleStateChange); - this.fire("changed", { state: this.state }, true); + this.fire("changed", { state: this.state, value: this.value }, true); }, _handleStateChange: function() { diff --git a/src/strand-form/index.html b/src/strand-form/index.html index 136da613..fcb07f3b 100644 --- a/src/strand-form/index.html +++ b/src/strand-form/index.html @@ -36,8 +36,8 @@ + -
@@ -64,7 +64,7 @@ - +
-
- + --> \ No newline at end of file diff --git a/src/strand-test-form-view/strand-test-form-view.html b/src/strand-test-form-view/strand-test-form-view.html index a8ffc92b..5bd2032d 100644 --- a/src/strand-test-form-view/strand-test-form-view.html +++ b/src/strand-test-form-view/strand-test-form-view.html @@ -31,23 +31,23 @@
- - List Item 1 - List Item 2 - List Item 3 - List Item 4 + + List Item 1 + List Item 2 + List Item 3 + List Item 4
- - + + - + - + @@ -104,15 +104,15 @@ Campaign Frequency Cap
= 0; }, - // noValidate: function(name, value, data, view) { - // return view.standardSize; - // }, errorMsg: 'Enter a width', parentEle: 'widthHeightWrapper' }, @@ -88,38 +82,27 @@ validation: function(name, value, data, view) { return parseInt(value) >= 0; }, - // noValidate: function(name, value, data, view) { - // return view.standardSize; - // }, errorMsg: 'Enter a height', parentEle: 'widthHeightWrapper' }, // second custom item - 'use_mm_freq' : { - // doesn't need anything - }, + 'use_mm_freq' : {}, 'frequency_type' : { parentEle: 'freqCapWrapper', validation: 'empty', - // noValidate: function(name, value, data, view) { - // return view.use_mm_freq; - // }, errorMsg: 'Select a type' }, 'frequency_amount' : { parentEle: 'freqCapWrapper', validation: 'int|empty', - // noValidate: function(name, value, data, view) { - // return view.use_mm_freq; - // }, errorMsg: 'Enter an amount' }, 'frequency_interval' : { parentEle: 'freqCapWrapper', validation: 'empty', - // noValidate: function(name, value, data, view) { - // return view.use_mm_freq; - // }, + noValidate: function(name, value, data, view) { + return !view.use_mm_freq; + }, errorMsg: 'Select an interval' } } @@ -149,9 +132,9 @@ }, _standardSizeDdl: function(e) { - var dimensions = e.detail.value.split('x'), - width = parseInt(dimensions[0]), - height = parseInt(dimensions[1]); + var dimensions = e.detail.value.split('x'); + var width = parseInt(dimensions[0]); + var height = parseInt(dimensions[1]); this._dimensionsChanged(width, height); }, @@ -177,13 +160,9 @@ this.frequency_interval = e.detail.value; }, - _useMMFreqOnChange: function(e) { - if (e.detail.state === 'checked') { - this.use_mm_freq = 1; - } else if (e.detail.state === 'unchecked') { - this.use_mm_freq = 0; - } - }, + // _useMMFreqOnChange: function(e) { + // this.use_mm_freq = e.detail.value | 0; + // }, _useMMFreqChanged: function(newVal, oldVal) { if (!newVal) { @@ -191,6 +170,10 @@ this.$.testForm.resetFieldValidation('frequency_interval'); this.$.testForm.resetFieldValidation('frequency_amount'); } + }, + + _useMMFreq: function(use_mm_freq) { + return !use_mm_freq; } }); diff --git a/test/strand-form.html b/test/strand-form.html index b112b79e..348aeeb2 100644 --- a/test/strand-form.html +++ b/test/strand-form.html @@ -25,7 +25,7 @@ List Item 4
-
+
@@ -38,57 +38,75 @@
+
+ +
- -
- -
-
- - List Item 1 - List Item 2 - List Item 3 - List Item 4 - - -
-
- - - - - - - - - - - -
-
+