renamed deflt and default to defaultValue
+ adds a div container around the each Input
This commit is contained in:
parent
483e19adb6
commit
3f1cbb20d3
2 changed files with 6 additions and 4 deletions
|
|
@ -138,8 +138,8 @@ $(function() {
|
|||
return control;
|
||||
}
|
||||
|
||||
if (control.hasOwnProperty("template") && control.hasOwnProperty("key") && control.hasOwnProperty("deflt") && control.hasOwnProperty("template_key") && !control.hasOwnProperty("output")) {
|
||||
control.output = ko.observable(control.deflt);
|
||||
if (control.hasOwnProperty("template") && control.hasOwnProperty("key") && control.hasOwnProperty("defaultValue") && control.hasOwnProperty("template_key") && !control.hasOwnProperty("output")) {
|
||||
control.output = ko.observable(control.defaultValue);
|
||||
if (!self.feedbackControlLookup.hasOwnProperty(control.key)) {
|
||||
self.feedbackControlLookup[control.key] = {};
|
||||
}
|
||||
|
|
@ -158,7 +158,7 @@ $(function() {
|
|||
|
||||
if (control.hasOwnProperty("input")) {
|
||||
for (var i = 0; i < control.input.length; i++) {
|
||||
control.input[i].value = ko.observable(control.input[i].default);
|
||||
control.input[i].value = ko.observable(control.input[i].defaultValue);
|
||||
if (!control.input[i].hasOwnProperty("slider")) {
|
||||
control.input[i].slider = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -160,7 +160,8 @@
|
|||
</form>
|
||||
</script>
|
||||
<script type="text/html" id="customControls_controlTemplate_input">
|
||||
<!-- ko foreach: input -->
|
||||
<!-- ko foreach: input -->
|
||||
<div class="form-inline">
|
||||
<label style="cursor: default" data-bind="text: name"></label>
|
||||
<!-- ko if: slider -->
|
||||
<input type="number" style="width: 100px" data-bind="slider: {value: value, min: slider.min, max: slider.max, step: slider.step}">
|
||||
|
|
@ -168,6 +169,7 @@
|
|||
<!-- ko ifnot: slider -->
|
||||
<input type="text" class="input-small" data-bind="attr: {placeholder: name}, value: value">
|
||||
<!-- /ko -->
|
||||
</div>
|
||||
<!-- /ko -->
|
||||
</script>
|
||||
<script type="text/html" id="customControls_controlTemplate_output">
|
||||
|
|
|
|||
Loading…
Reference in a new issue