Updated for EditorCollectionPlugin

This commit is contained in:
Marc 2015-06-04 18:41:39 +02:00
parent b7179b75a8
commit c7f67b8fc0
2 changed files with 38 additions and 28 deletions

View File

@ -18,6 +18,16 @@ class CustomControlPlugin(octoprint.plugin.SettingsPlugin,
controls = []
)
def get_template_configs(self):
if "editorcollection" in self._plugin_manager.enabled_plugins:
return [
dict(type="plugin_editorcollection_EditorCollection", template="customControl_hookedsettings.jinja2", custom_bindings=True)
]
else:
return [
dict(type="settings", template="customControl_hookedsettings.jinja2", custom_bindings=True)
]
def on_settings_save(self, data):
s = settings()
s.set(["controls"], data["controls"])

View File

@ -1,6 +1,6 @@
<h4>{{ _('Control') }}</h4>
<div style="min-height:15px; margin: 16px 16px; border:1px solid #00e500" id="base" data-bind="contextMenu: { menuSelector: '#controlContextMenu', menuSelected: $root.controlContextMenu }, visible: loginState.isUser">
<div style="min-height:15px; margin: 16px 16px; border:1px solid #00e500" id="base" data-bind="contextMenu: { menuSelector: '#controlContextMenu', menuSelected: $root.controlContextMenu }">
</div>
<!-- "width: 588px" to be the same as teh real Control tab-->