From 55ed4211f9d6c7e74defa0f40b460d7d7ba871f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Fri, 8 Jul 2016 11:14:40 +0200 Subject: [PATCH] Fix highlighting of selected file in file list in frontend --- src/octoprint/static/js/app/viewmodels/files.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/octoprint/static/js/app/viewmodels/files.js b/src/octoprint/static/js/app/viewmodels/files.js index f06505c6..340393f3 100644 --- a/src/octoprint/static/js/app/viewmodels/files.js +++ b/src/octoprint/static/js/app/viewmodels/files.js @@ -157,12 +157,12 @@ $(function() { return self.loginState.isUser() && self.isOperational() && self.isLoadActionPossible(); }); - self.printerState.filename.subscribe(function(newValue) { + self.printerState.filepath.subscribe(function(newValue) { self.highlightFilename(newValue); }); self.highlightCurrentFilename = function() { - self.highlightFilename(self.printerState.filename()); + self.highlightFilename(self.printerState.filepath()); }; self.highlightFilename = function(filename) { @@ -876,24 +876,24 @@ $(function() { }; self._handleUploadDone = function(e, data) { - var filename = undefined; + var filepath = undefined; var location = undefined; if (data.result.files.hasOwnProperty("sdcard")) { - filename = data.result.files.sdcard.name; + filepath = data.result.files.sdcard.path; location = "sdcard"; } else if (data.result.files.hasOwnProperty("local")) { - filename = data.result.files.local.name; + filepath = data.result.files.local.path; location = "local"; } - self.requestData(filename, location, self.currentPath()) + self.requestData(filepath, location, self.currentPath()) .done(function() { if (data.result.done) { self._setProgressBar(0, "", false); } }); - if (_.endsWith(filename.toLowerCase(), ".stl")) { - self.slicing.show(location, filename); + if (_.endsWith(filepath.toLowerCase(), ".stl")) { + self.slicing.show(location, filepath); } };