lsellens / OctoPrint-Cr10_leveling

Adds bed leveling buttons to the controls tab on OctoPrint
GNU Affero General Public License v3.0
10 stars 10 forks source link

Use getAdditionalControls callback in frontend instead of manipulating the config in the backend #1

Closed foosel closed 6 years ago

foosel commented 6 years ago

FYI, instead of injecting your controls into the configuration:

https://github.com/electr0sheep/OctoPrint-Cr10_leveling/blob/4942918fe10b886a371685b78e96289e9167869a/octoprint_CR10_Leveling/__init__.py#L11-L22

you should declare your own JS asset with a view model and use the getAdditionalControls() view model callback instead - it's what it was made to do and runs less risk of interfering with people's settings ;)

electr0sheep commented 6 years ago

Thanks for the tip, I'll see what I can do!

electr0sheep commented 6 years ago

Thanks again for the tip @foosel, this makes everything much smoother!