diff --git a/src/octoprint/plugin/types.py b/src/octoprint/plugin/types.py index dce31c34..b2980b71 100644 --- a/src/octoprint/plugin/types.py +++ b/src/octoprint/plugin/types.py @@ -199,9 +199,7 @@ class TemplatePlugin(Plugin): or if a custom binding will be used by the plugin (``true``, default). data_bind Additional knockout data bindings to apply to the navbar entry, can be used to add further behaviour to - the container based on internal state if necessary. Note that if you include this and set ``custom_bindings`` - to ``True``, you need to also supply ``allowBindings: true`` as part of your custom data binding, otherwise - it won't work. + the container based on internal state if necessary. classes Additional classes to apply to the navbar entry, as a list of individual classes (e.g. ``classes=["myclass", "myotherclass"]``) which will be joined into the correct format by the template engine. @@ -231,9 +229,7 @@ class TemplatePlugin(Plugin): or if a custom binding will be used by the plugin (``true``, default). data_bind Additional knockout data bindings to apply to the template container, can be used to add further behaviour to - the container based on internal state if necessary. Note that if you include this and set ``custom_bindings`` - to ``True``, you need to also supply ``allowBindings: true`` as part of your custom data binding, otherwise - it won't work. + the container based on internal state if necessary. classes Additional classes to apply to both the wrapper around the sidebar box as well as the content pane itself, as a list of individual classes (e.g. ``classes=["myclass", "myotherclass"]``) which will be joined into the correct @@ -267,9 +263,7 @@ class TemplatePlugin(Plugin): in the navigation (``false``) or if a custom binding will be used by the plugin (``true``, default). data_bind Additional knockout data bindings to apply to the template container, can be used to add further behaviour to - the container based on internal state if necessary. Note that if you include this and set ``custom_bindings`` - to ``True``, you need to also supply ``allowBindings: true`` as part of your custom data binding, otherwise - it won't work. + the container based on internal state if necessary. classes Additional classes to apply to both the wrapper around the sidebar box as well as the content pane itself, as a list of individual classes (e.g. ``classes=["myclass", "myotherclass"]``) which will be joined into the correct @@ -303,9 +297,7 @@ class TemplatePlugin(Plugin): in the navigation (``false``) or if a custom binding will be used by the plugin (``true``, default). data_bind Additional knockout data bindings to apply to the template container, can be used to add further behaviour to - the container based on internal state if necessary. Note that if you include this and set ``custom_bindings`` - to ``True``, you need to also supply ``allowBindings: true`` as part of your custom data binding, otherwise - it won't work. + the container based on internal state if necessary. classes Additional classes to apply to both the wrapper around the navigation link as well as the content pane itself, as a list of individual classes (e.g. ``classes=["myclass", "myotherclass"]``) which will be joined into the correct diff --git a/src/octoprint/server/__init__.py b/src/octoprint/server/__init__.py index ae03b2f0..c1fcdd71 100644 --- a/src/octoprint/server/__init__.py +++ b/src/octoprint/server/__init__.py @@ -300,6 +300,11 @@ def _process_template_config(name, implementation, rule, config=None, counter=1) data["template"] = rule["template"](name) if not "name" in data: data["name"] = implementation._plugin_name + if not "custom_bindings" in data or data["custom_bindings"]: + data_bind = "allowBindings: true" + if "data_bind" in data: + data_bind = data_bind + ", " + data["data_bind"] + data["data_bind"] = data_bind return data diff --git a/src/octoprint/templates/dialogs/settings.jinja2 b/src/octoprint/templates/dialogs/settings.jinja2 index dce73fc4..c6ab24a9 100644 --- a/src/octoprint/templates/dialogs/settings.jinja2 +++ b/src/octoprint/templates/dialogs/settings.jinja2 @@ -13,7 +13,7 @@ {% else %} {% if "custom_bindings" not in data or data["custom_bindings"] %}{% endif %}
  • @@ -42,7 +42,7 @@ {% if "custom_bindings" not in data or data["custom_bindings"] %}{% endif %}
    @@ -73,7 +73,7 @@ {% if "custom_bindings" not in data or data["custom_bindings"] %}{% endif %}