From bdc5d72613c9d1af6648e88ab80dde9ffb285575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 28 Sep 2015 18:41:40 +0200 Subject: [PATCH] Fixes OctoPrint.files.download method --- src/octoprint/static/js/app/client/files.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/octoprint/static/js/app/client/files.js b/src/octoprint/static/js/app/client/files.js index 2e76f5f4..84d26f17 100644 --- a/src/octoprint/static/js/app/client/files.js +++ b/src/octoprint/static/js/app/client/files.js @@ -23,7 +23,13 @@ return OctoPrint.issueCommand(url, command, data, opts); }; + var getFile = function(location, filename, opts) { + return OctoPrint.get(resourceForFile(location, filename), opts); + }; + OctoPrint.files = { + get: getFile, + list: function (opts) { return OctoPrint.get(url, opts); }, @@ -32,10 +38,6 @@ return OctoPrint.get(resourceForLocation(location), opts); }, - get: function (location, filename, opts) { - return OctoPrint.get(resourceForFile(location, filename), opts); - }, - select: function (location, filename, print, opts) { print = print || false; @@ -64,7 +66,7 @@ download: function (location, filename, opts) { var deferred = $.Deferred(); - exports.get(location, filename, opts) + getFile(location, filename, opts) .done(function (response) { OctoPrint.download(response.refs.download, opts) .done(function () {