From 4422af26ecb0c967a36132837bda399fea837d73 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Mon, 27 Sep 2021 17:35:49 +0100 Subject: [PATCH] Try to handle smaller screen sizes in tourGuide --- .../@node-red/editor-client/src/js/ui/tour/tourGuide.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/tour/tourGuide.js b/packages/node_modules/@node-red/editor-client/src/js/ui/tour/tourGuide.js index 755d264d7..b71745d85 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/tour/tourGuide.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/tour/tourGuide.js @@ -199,6 +199,11 @@ RED.tourGuide = (function() { shade.hide(); throw new Error("Element not found") } + if ($(window).width() < 400) { + targetElement = $(".red-ui-editor"); + fullscreen = true; + direction = "inset"; + } zIndex = targetElement.css("z-index"); if (!fullscreen) { @@ -290,7 +295,7 @@ RED.tourGuide = (function() { if (fullscreen) { width = 500; } - var maxWidth = Math.max(width || 0, 300); + var maxWidth = Math.min($(window).width()-10,Math.max(width || 0, 300)); if (!popover) { popover = RED.popover.create({ target: targetElement,