Move next on click of overlay

This commit is contained in:
Kamran Ahmed
2018-04-10 19:31:58 +02:00
parent 6dc5bde6e2
commit ddf993e7df
5 changed files with 5 additions and 5 deletions
+1
View File
@@ -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
+1 -1
View File
@@ -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
-1
View File
@@ -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
View File
@@ -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;
}
+1 -1
View File
@@ -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