From 7bdd260617b70fcde63aa834e3daa71b56ea9821 Mon Sep 17 00:00:00 2001 From: ntoff Date: Sat, 11 Nov 2017 21:41:07 +1000 Subject: [PATCH] use other view model push method http://docs.octoprint.org/en/master/plugins/viewmodels.html#registering-custom-viewmodels says the other way is depreciated --- octoprint_fanspeedslider/static/js/fanslider.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/octoprint_fanspeedslider/static/js/fanslider.js b/octoprint_fanspeedslider/static/js/fanslider.js index 5ca6260..1ace80d 100644 --- a/octoprint_fanspeedslider/static/js/fanslider.js +++ b/octoprint_fanspeedslider/static/js/fanslider.js @@ -62,8 +62,12 @@ $(function() { fanSpeed(self.settings.settings.plugins.fanspeedslider.defaultFanSpeed()); } } - OCTOPRINT_VIEWMODELS.push([ - FanSliderPluginViewModel, - ["settingsViewModel", "controlViewModel", "loginStateViewModel"] - ]); -}); + + OCTOPRINT_VIEWMODELS.push({ + construct: FanSliderPluginViewModel, + additionalNames: [], + dependencies: ["settingsViewModel", "controlViewModel", "loginStateViewModel"], + optional: [], + elements: [] + }); +}); \ No newline at end of file