From 0267250af454542843dafddf0bec28f8d431a8ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 26 Oct 2020 15:22:48 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Move=20knockout=20init=20t?= =?UTF-8?q?o=20an=20earlier=20point?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/octoprint/static/js/app/main.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/octoprint/static/js/app/main.js b/src/octoprint/static/js/app/main.js index 51e2b21c1..eae1d5e51 100644 --- a/src/octoprint/static/js/app/main.js +++ b/src/octoprint/static/js/app/main.js @@ -8,6 +8,11 @@ $(function () { _.mixin({sprintf: sprintf, vsprintf: vsprintf}); + //~~ Knockout setup + + ko.options.createChildContextWithAs = true; + ko.options.foreachHidesDestroyed = true; + //~~ Logging setup log.setLevel(CONFIG_DEBUG ? log.levels.DEBUG : log.levels.INFO); @@ -707,8 +712,6 @@ $(function () { var bindViewModels = function () { try { - ko.options.createChildContextWithAs = true; - ko.options.foreachHidesDestroyed = true; log.info("Going to bind " + allViewModelData.length + " view models..."); _.each(allViewModelData, function (viewModelData) { try {