Try to handle smaller screen sizes in tourGuide

This commit is contained in:
Nick O'Leary 2021-09-27 17:35:49 +01:00
parent 5329e803e2
commit 4422af26ec
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
1 changed files with 6 additions and 1 deletions

View File

@ -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,