From 1a20665729c726d6a16ced9629854817017177bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 18 Nov 2015 17:45:15 +0100 Subject: [PATCH] Minor code style corrections --- src/octoprint/static/js/app/client/files.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/octoprint/static/js/app/client/files.js b/src/octoprint/static/js/app/client/files.js index 69f1d700..94b8a5f5 100644 --- a/src/octoprint/static/js/app/client/files.js +++ b/src/octoprint/static/js/app/client/files.js @@ -119,12 +119,14 @@ }, pathForElement: function(element) { - if (!element || !element.hasOwnProperty("parent") || element.parent == undefined) + if (!element || !element.hasOwnProperty("parent") || element.parent == undefined) { return ""; + } var recursivePath = function(element, path) { - if (element.hasOwnProperty("parent") && element.parent != undefined) + if (element.hasOwnProperty("parent") && element.parent != undefined) { return recursivePath(element.parent, element.name + "/" + path); + } return path; }; @@ -134,11 +136,13 @@ elementByPath: function(location, startElement) { var recursiveSearch = function(location, element) { - if (location.length == 0) + if (location.length == 0) { return element; + } - if (!element.hasOwnProperty("children")) + if (!element.hasOwnProperty("children")) { return undefined; + } var name = location.shift(); for(var i = 0; i < element.children.length; i++) {