提交 ddf993e7 编写于 作者: K Kamran Ahmed

Move next on click of overlay

上级 6dc5bde6
......@@ -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;
......
......@@ -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;
}
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册