Some small adjustments and fixes

This commit is contained in:
Marc 2015-04-19 21:46:14 +02:00
parent f531220f8d
commit ce165e11fb
2 changed files with 9 additions and 12 deletions

View File

@ -94,8 +94,6 @@
else { else {
control.template = ko.observable(control.template); control.template = ko.observable(control.template);
control.regex = ko.observable(control.regex); control.regex = ko.observable(control.regex);
control.output = ko.computed(function () { return control.template(); });
} }
} }
@ -108,7 +106,6 @@
control.layout = ko.observable("vertical"); control.layout = ko.observable("vertical");
} }
else { else {
control.name = ko.observable(control.name);
control.children = ko.observableArray(self._processControls(control, control.children)); control.children = ko.observableArray(self._processControls(control, control.children));
if (!control.hasOwnProperty("layout") || !(control.layout == "vertical" || control.layout == "horizontal" || control.layout == "horizontal_grid")) if (!control.hasOwnProperty("layout") || !(control.layout == "vertical" || control.layout == "horizontal" || control.layout == "horizontal_grid"))
control.layout = ko.observable("vertical"); control.layout = ko.observable("vertical");

View File

@ -69,14 +69,14 @@
</script> </script>
<script type="text/html" id="settingsCustomControls_controlTemplate"> <script type="text/html" id="settingsCustomControls_controlTemplate">
<form class="form-inline control-tab custom_control" style="min-height:15px; border:1px dotted #000000" data-bind="contextMenu: { menuSelector: '#commandContextMenu', menuSelected: $root.controlContextMenu }, attr: { 'id': id }"> <form class="form-inline control-tab custom_control" style="min-height:15px; border:1px dotted #000000" data-bind="contextMenu: { menuSelector: '#commandContextMenu', menuSelected: $root.controlContextMenu }, attr: { 'id': id }">
<!-- ko template: { name: 'customControls_controlTemplate_input', data: $data, if: $data.hasOwnProperty('input') } --><!-- /ko --> <!-- ko template: { name: 'settingsCustomControls_controlTemplate_input', data: $data, if: $data.hasOwnProperty('input') } --><!-- /ko -->
<!-- ko template: { name: 'customControls_controlTemplate_command', data: $data, if: $data.hasOwnProperty('command') || $data.hasOwnProperty('commands') || $data.hasOwnProperty('script') || $data.hasOwnProperty('javascript') } --><!-- /ko --> <!-- ko template: { name: 'settingsCustomControls_controlTemplate_command', data: $data, if: $data.hasOwnProperty('command') || $data.hasOwnProperty('commands') || $data.hasOwnProperty('script') || $data.hasOwnProperty('javascript') } --><!-- /ko -->
<!-- ko template: { name: 'customControls_controlTemplate_output', data: $data, if: $data.hasOwnProperty('output') } --><!-- /ko --> <!-- ko template: { name: 'settingsCustomControls_controlTemplate_output', data: $data, if: $data.hasOwnProperty('template') } --><!-- /ko -->
</form> </form>
</script> </script>
<script type="text/html" id="customControls_controlTemplate_input"> <script type="text/html" id="settingsCustomControls_controlTemplate_input">
<!-- ko foreach: input --> <!-- ko foreach: input -->
<label data-bind="text: name"></label> <label style="cursor: default" data-bind="text: name"></label>
<!-- ko if: slider --> <!-- ko if: slider -->
<input type="number" style="width: 100px" data-bind="slider: {value: value, min: slider.min, max: slider.max, step: slider.step}"> <input type="number" style="width: 100px" data-bind="slider: {value: value, min: slider.min, max: slider.max, step: slider.step}">
<!-- /ko --> <!-- /ko -->
@ -85,10 +85,10 @@
<!-- /ko --> <!-- /ko -->
<!-- /ko --> <!-- /ko -->
</script> </script>
<script type="text/html" id="customControls_controlTemplate_output"> <script type="text/html" id="settingsCustomControls_controlTemplate_output">
<label data-bind="text: output"></label> <label style="cursor: default" data-bind="text: template"></label>
</script> </script>
<script type="text/html" id="customControls_controlTemplate_command"> <script type="text/html" id="settingsCustomControls_controlTemplate_command">
<button class="btn" data-bind="text: name }"></button> <button class="btn" data-bind="text: name"></button>
</script> </script>
<!-- End of templates for custom controls --> <!-- End of templates for custom controls -->