Merge pull request #3172 from node-red/tour-210

Update welcome tour for 2.1.0-beta.1
This commit is contained in:
Nick O'Leary
2021-10-07 09:34:52 +01:00
committed by GitHub
4 changed files with 107 additions and 21 deletions

View File

@@ -119,6 +119,7 @@ RED.tabs = (function() {
menuOptions = options.menu;
}
menu = RED.menu.init({options: menuOptions});
menu.attr("id",options.id+"-menu");
menu.css({
position: "absolute"
})

View File

@@ -44,9 +44,9 @@ RED.tourGuide = (function() {
function repositionFocus() {
if (targetElement) {
var pos = targetElement[0].getBoundingClientRect();
var dimension = Math.max(50, Math.max(pos.width,pos.height)*1.5);
if (!fullscreen) {
var pos = targetElement[0].getBoundingClientRect();
var dimension = Math.max(50, Math.max(pos.width,pos.height)*1.5);
focus.css({
left: (pos.left+pos.width/2)+"px",
top: (pos.top+pos.height/2)+"px",
@@ -142,7 +142,19 @@ RED.tourGuide = (function() {
if (step.prepare.length === 0) {
step.prepare.call(state);
} else {
step.prepare.call(state, done)
if (popover) {
popover.element.hide();
if (!fullscreen) {
fullscreen = true;
repositionFocus()
}
}
step.prepare.call(state, function() {
if (popover) {
popover.element.show();
}
done();
})
return;
}
}
@@ -159,7 +171,19 @@ RED.tourGuide = (function() {
if (step.complete.length === 0) {
step.complete.call(state);
} else {
step.complete.call(state, finish)
if (popover) {
popover.element.hide();
if (!fullscreen) {
fullscreen = true;
repositionFocus()
}
}
step.complete.call(state, function() {
if (popover) {
popover.element.show();
}
finish();
})
return;
}
}
@@ -206,11 +230,10 @@ RED.tourGuide = (function() {
}
zIndex = targetElement.css("z-index");
if (!fullscreen) {
if (!fullscreen && (step.interactive || step.wait)) {
targetElement.css("z-index",2002);
}
repositionFocus();
focus.toggleClass("disableInteraction", step.interactive === false)
if (!stepContent) {
stepContent = $('<div style="position:relative"></div>');
@@ -329,7 +352,7 @@ RED.tourGuide = (function() {
if (nextButton) {
setTimeout(function() {
nextButton.focus();
},50);
},100);
}
var isSVG = targetElement[0] instanceof SVGElement;