Added form-level change event

This commit is contained in:
Henry 2016-02-08 17:46:21 -08:00
parent 9371fcbc4c
commit be031285b9
7 changed files with 18 additions and 23 deletions

View File

@ -46,6 +46,7 @@ define(
*/
this.xAxisForm = {
'name':'x-axis',
'onchange': onchange,
'sections': [{
'name': 'x-axis',
'rows': [
@ -53,7 +54,6 @@ define(
'name': 'Domain',
'control': 'select',
'key': 'key',
'onchange': onchange,
'options': [
{'name':'scet', 'value': 'scet'},
{'name':'sclk', 'value': 'sclk'},
@ -65,6 +65,7 @@ define(
this.yAxisForm = {
'name':'y-axis',
'onchange': onchange,
'sections': [{
// Will need to be repeated for each y-axis, with a
// distinct name for each. Ideally the name of the axis
@ -74,28 +75,24 @@ define(
{
'name': 'Autoscale',
'control': 'checkbox',
'key': 'autoscale',
'onchange': onchange
'key': 'autoscale'
},
{
'name': 'Min',
'control': 'textfield',
'key': 'min',
'pattern': '[0-9]',
'onchange': onchange
'pattern': '[0-9]'
},
{
'name': 'Max',
'control': 'textfield',
'key': 'max',
'pattern': '[0-9]',
'onchange': onchange
'pattern': '[0-9]'
},
{
'name': 'Range',
'control': 'select',
'key': 'key',
'onchange': onchange,
'options': [
{'name':'eu', 'value': 'eu'},
{'name':'dn', 'value': 'dn'},
@ -107,14 +104,14 @@ define(
};
this.plotSeriesForm = {
'name':'Series Options',
'onchange': onchange,
'sections': [
{
rows: [
{
'name': 'Color',
'control': 'color',
'key': 'color',
'onchange': onchange
'key': 'color'
}]
},
{
@ -122,8 +119,7 @@ define(
{
'name': 'Markers',
'control': 'checkbox',
'key': 'markers',
'onchange': onchange
'key': 'markers'
}
]
},
@ -133,22 +129,19 @@ define(
'name': 'No Line',
'control': 'radio',
'key': 'lineType',
'value': 'noLine',
'onchange': onchange
'value': 'noLine'
},
{
'name': 'Step Line',
'control': 'radio',
'key': 'lineType',
'value': 'stepLine',
'onchange': onchange
'value': 'stepLine'
},
{
'name': 'Linear Line',
'control': 'radio',
'key': 'lineType',
'value': 'linearLine',
'onchange': onchange
'value': 'linearLine'
}
]
}

View File

@ -23,7 +23,7 @@
<input type="checkbox"
name="mctControl"
ng-model="ngModel[field]"
ng-change="structure.onchange(ngModel[field])"
ng-change="ngChange()"
ng-disabled="ngDisabled">
<em></em>
</label>

View File

@ -24,7 +24,7 @@
name="mctControl"
ng-model="ngModel[field]"
ng-disabled="ngDisabled"
ng-change="structure.onchange(ngModel[field])"
ng-change="ngChange()"
ng-value="structure.value">
<em></em>
</label>

View File

@ -24,7 +24,7 @@
ng-model="ngModel[field]"
ng-options="opt.value as opt.name for opt in options"
ng-required="ngRequired"
ng-change="structure.onchange(ngModel[field])"
ng-change="ngChange()"
name="mctControl">
<option value="" ng-show="!ngModel[field]">- Select One -</option>
</select>

View File

@ -25,7 +25,7 @@
ng-required="ngRequired"
ng-model="ngModel[field]"
ng-pattern="ngPattern"
ng-change="structure.onchange(ngModel[field])"
ng-change="ngChange()"
size="{{structure.size}}"
name="mctControl">
</span>

View File

@ -41,7 +41,7 @@
<mct-control key="row.control"
ng-model="ngModel"
ng-required="row.required"
ng-change="row.onchange"
ng-change="row.onchange(ngModel[row.key]); structure.onchange(ngModel)"
ng-pattern="getRegExp(row.pattern)"
options="row.options"
structure="row"

View File

@ -97,6 +97,8 @@ define(
// Set of choices (if any)
options: "=",
ngChange: "&",
// Structure (subtree of Form Structure)
structure: "=",