updated to reflect PR on OctoPrint
This commit is contained in:
parent
09ff8e9953
commit
7a6877e709
@ -231,7 +231,7 @@
|
||||
}
|
||||
|
||||
control.name = ko.observable(control.name || "");
|
||||
control.style = ko.observable(control.style || "");
|
||||
control.customClass = ko.observable(control.customClass || "");
|
||||
|
||||
control.width = ko.observable(control.hasOwnProperty("width") ? control.width : "2");
|
||||
control.offset = ko.observable(control.hasOwnProperty("offset") ? control.offset : "");
|
||||
@ -321,7 +321,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
element.style("btn " + style);
|
||||
element.customClass("btn " + style);
|
||||
}
|
||||
self.deleteElement = function (invokedOn, contextParent, selectedMenu) {
|
||||
var element = self.searchElement(self.controlsFromServer, contextParent.attr('id'));
|
||||
|
@ -59,7 +59,7 @@
|
||||
self.reset = function (data) {
|
||||
var element = {
|
||||
name: undefined,
|
||||
style: "",
|
||||
cusotmClass: "",
|
||||
collapsed: false,
|
||||
commands: "",
|
||||
confirm: "",
|
||||
@ -106,7 +106,7 @@
|
||||
}
|
||||
case "command": {
|
||||
el.name = obj.name;
|
||||
el.style = "btn";
|
||||
el.customClass = "btn";
|
||||
if (obj.commands.indexOf('\n') == -1)
|
||||
el.command = obj.commands;
|
||||
else
|
||||
@ -167,7 +167,7 @@
|
||||
case "script":
|
||||
{
|
||||
el.name = obj.name;
|
||||
el.style = "btn";
|
||||
el.customClass = "btn";
|
||||
el.script = obj.script;
|
||||
|
||||
if (self.useConfirm()) {
|
||||
|
@ -86,10 +86,9 @@
|
||||
</script>
|
||||
<script type="text/html" id="settingsCustomControls_controlTemplate">
|
||||
<form class="form-inline custom_control" style="min-height:15px; border:1px dotted #000000" data-bind="contextMenu: { menuSelector: '#commandContextMenu', menuSelected: $root.controlContextMenu }, css: { 'sortable': $parent.layout() != 'horizontal_grid' }, attr: { 'id': id }">
|
||||
<div data-bind="text: console.log($data)"></div>
|
||||
<!-- ko template: { name: 'settingsCustomControls_controlTemplate_input', data: $data, if: $data.hasOwnProperty('input') } --><!-- /ko -->
|
||||
<!-- ko template: { name: 'settingsCustomControls_controlTemplate_command', data: $data, if: !$data.hasOwnProperty('style') && ($data.hasOwnProperty('command') || $data.hasOwnProperty('commands') || $data.hasOwnProperty('script') || $data.hasOwnProperty('javascript')) } --><!-- /ko -->
|
||||
<!-- ko template: { name: 'settingsCustomControls_controlTemplate_command_styled', data: $data, if: $data.hasOwnProperty('style') && ($data.hasOwnProperty('command') || $data.hasOwnProperty('commands') || $data.hasOwnProperty('script') || $data.hasOwnProperty('javascript')) } --><!-- /ko -->
|
||||
<!-- ko template: { name: 'settingsCustomControls_controlTemplate_command', data: $data, if: !$data.hasOwnProperty('customClass') && ($data.hasOwnProperty('command') || $data.hasOwnProperty('commands') || $data.hasOwnProperty('script') || $data.hasOwnProperty('javascript')) } --><!-- /ko -->
|
||||
<!-- ko template: { name: 'settingsCustomControls_controlTemplate_command_customClass', data: $data, if: $data.hasOwnProperty('customClass') && ($data.hasOwnProperty('command') || $data.hasOwnProperty('commands') || $data.hasOwnProperty('script') || $data.hasOwnProperty('javascript')) } --><!-- /ko -->
|
||||
<!-- ko template: { name: 'settingsCustomControls_controlTemplate_output', data: $data, if: $data.hasOwnProperty('value') } --><!-- /ko -->
|
||||
</form>
|
||||
</script>
|
||||
@ -110,7 +109,7 @@
|
||||
<script type="text/html" id="settingsCustomControls_controlTemplate_command">
|
||||
<button class="btn" data-bind="text: name" onclick="event.preventDefault()"></button>
|
||||
</script>
|
||||
<script type="text/html" id="settingsCustomControls_controlTemplate_command_styled">
|
||||
<button data-bind="text: name, attr: { 'class': style }" onclick="event.preventDefault()"></button>
|
||||
<script type="text/html" id="settingsCustomControls_controlTemplate_command_customClass">
|
||||
<button data-bind="text: name, attr: { 'class': customClass }" onclick="event.preventDefault()"></button>
|
||||
</script>
|
||||
<!-- End of templates for custom controls -->
|
||||
|
Loading…
Reference in New Issue
Block a user