Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to execute a non driver.js function when the Done button is clicked in a tour? #218

Closed
FaramarzPDA opened this issue Feb 6, 2020 · 3 comments

Comments

@FaramarzPDA
Copy link

I need to do more and execute other functions on the page when the "Done" button is clicked on the last pop-over Tour. I added a className to the last pop-over, I thought that helps to find and target the Done button on the last pop-over but it doesn't look all steps are available in DOM when the page is loaded.

@kamranahmedse
Copy link
Owner

You can do that using onReset

@FaramarzPDA
Copy link
Author

Thanks, did you mean something like this?

element: '#masonry-drop-down',
	popover: {
    	className: 'last-step-popover',
		title: 'Filter',
      	description: 'This is how you can filter the news by Category.',
      	position: 'right'
    },
	onReset: () => {
		console.log('closed now');
	}

I tried this and it didn't do anything for me.

@FaramarzPDA
Copy link
Author

Never mind, I think I called it in a wrong location, this worked for me:

const driver = new Driver({
	onReset: () => {
		console.log('closed now');
	}
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants