From 1a5f4e0b9fb89bc4ad60531ffc744cd726608eb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 16 Nov 2016 16:04:43 +0100 Subject: [PATCH] Stop focusing files in list after deleted file Looks weird, especially with the new yellow highlight. --- .../static/js/app/viewmodels/files.js | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/src/octoprint/static/js/app/viewmodels/files.js b/src/octoprint/static/js/app/viewmodels/files.js index 03ec1473..24695b2d 100644 --- a/src/octoprint/static/js/app/viewmodels/files.js +++ b/src/octoprint/static/js/app/viewmodels/files.js @@ -441,20 +441,6 @@ $(function() { }; self._removeEntry = function(entry, event) { - var index = self.listHelper.paginatedItems().indexOf(entry) + 1; - if (index >= self.listHelper.paginatedItems().length) { - index = index - 2; - } - if (index < 0) { - index = 0; - } - - var focus = undefined; - var fileToFocus = self.listHelper.paginatedItems()[index]; - if (fileToFocus) { - focus = {location: fileToFocus.origin, path: fileToFocus.path}; - } - self.activeRemovals.push(entry.origin + ":" + entry.path); var finishActiveRemoval = function() { self.activeRemovals(_.filter(self.activeRemovals(), function(e) { @@ -485,10 +471,7 @@ $(function() { var deferred = $.Deferred(); OctoPrint.files.delete(entry.origin, entry.path) .done(function() { - self.requestData({ - focus: focus, - switchToPath: (entry.parent ? entry.parent.path : "") - }) + self.requestData() .done(function() { deferred.resolve(); })