From 8695e74807501bb447eb44ab53f4f476e5d43c45 Mon Sep 17 00:00:00 2001 From: bartbutenaers Date: Sat, 9 Jan 2021 18:14:56 +0100 Subject: [PATCH] Allow empty ui path --- joystick.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/joystick.js b/joystick.js index d60f683..72b084d 100644 --- a/joystick.js +++ b/joystick.js @@ -302,8 +302,15 @@ module.exports = function(RED) { // //ui: { path: "ui" }, // But as soon as the user has specified a custom UI path there, we will need to use that path: // ui: { path: "mypath" }, - var uiPath = ((RED.settings.ui || {}).path) || 'ui'; - + var uiPath = (RED.settings.ui || {}).path; + + // When there was no ui path specified (i.e. '//ui: { path: "ui" }' not commented out in the settings.js file), then + // we need to apply the default 'ui' path. However, when an empty ui path has been specified (i.e. '//ui: { path: "" }'), then + // we should also use an empty ui path... See https://github.com/bartbutenaers/node-red-contrib-ui-svg/issues/86 + if (uiPath == undefined) { + uiPath = 'ui'; + } + // Create the complete server-side path uiPath = '/' + uiPath + '/ui_joystick/js/*';