mirror of
https://github.com/kamranahmedse/driver.js.git
synced 2026-10-31 03:52:13 +08:00
Move next on click of overlay
This commit is contained in:
@@ -272,6 +272,7 @@ driver.highlight({
|
||||
opacity: 0.75, // Background opacity (0 means only popovers and without overlay)
|
||||
padding: 10, // Distance of element from around the edges
|
||||
allowClose: true, // Whether clicking on overlay should close or not
|
||||
overlayClickNext: false, // Should it move to next step on overlay click
|
||||
doneBtnText: 'Done', // Text on the final button
|
||||
closeBtnText: 'Close', // Text on the close button for this step
|
||||
nextBtnText: 'Next', // Next button text for this step
|
||||
|
||||
@@ -160,7 +160,7 @@ const driver = new Driver({
|
||||
opacity: 0.75, // Background opacity (0 means only popovers and without overlay)
|
||||
padding: 10, // Distance of element from around the edges
|
||||
allowClose: true, // Whether the click on overlay should close or not
|
||||
outsideClickNext: false, // Whether the click on overlay should move next
|
||||
overlayClickNext: false, // Whether the click on overlay should move next
|
||||
doneBtnText: 'Done', // Text on the final button
|
||||
closeBtnText: 'Close', // Text on the close button for this step
|
||||
stageBackground: '#ffffff', // Background color for the staged behind highlighted element
|
||||
|
||||
@@ -3,7 +3,6 @@ export const OVERLAY_PADDING = 10;
|
||||
|
||||
export const SHOULD_ANIMATE_OVERLAY = true;
|
||||
export const SHOULD_OUTSIDE_CLICK_CLOSE = true;
|
||||
|
||||
export const SHOULD_OUTSIDE_CLICK_NEXT = false;
|
||||
|
||||
export const ESC_KEY_CODE = 27;
|
||||
|
||||
+2
-2
@@ -32,7 +32,7 @@ export default class Driver {
|
||||
padding: OVERLAY_PADDING, // Spacing around the element from the overlay
|
||||
scrollIntoViewOptions: null, // Options to be passed to `scrollIntoView`
|
||||
allowClose: SHOULD_OUTSIDE_CLICK_CLOSE, // Whether to close overlay on click outside the element
|
||||
outsideClickNext: SHOULD_OUTSIDE_CLICK_NEXT, // Whether to move next on click outside the element
|
||||
overlayClickNext: SHOULD_OUTSIDE_CLICK_NEXT, // Whether to move next on click outside the element
|
||||
stageBackground: '#ffffff', // Background color for the stage
|
||||
onHighlightStarted: () => { // When element is about to be highlighted
|
||||
},
|
||||
@@ -89,7 +89,7 @@ export default class Driver {
|
||||
const clickedHighlightedElement = highlightedElement.node.contains(e.target);
|
||||
const clickedPopover = popover && popover.contains(e.target);
|
||||
|
||||
if (!clickedHighlightedElement && !clickedPopover && this.options.outsideClickNext) {
|
||||
if (!clickedHighlightedElement && !clickedPopover && this.options.overlayClickNext) {
|
||||
this.moveNext();
|
||||
return;
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -649,7 +649,7 @@ declare module 'driver.js' {
|
||||
* Clicking outside the highlighted element should move next
|
||||
* @default false
|
||||
*/
|
||||
outsideClickNext?: boolean,
|
||||
overlayClickNext?: boolean,
|
||||
|
||||
/**
|
||||
* Background color for the stage behind the highlighted element
|
||||
|
||||
Reference in New Issue
Block a user