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

Add data attribute to the body for the currently active tour name and current step #284

Closed
BrianSipple opened this issue Oct 23, 2018 · 2 comments
Assignees

Comments

@BrianSipple
Copy link
Contributor

Following up on the discussion here

@BrianSipple BrianSipple self-assigned this Oct 23, 2018
@BrianSipple BrianSipple changed the title Add data attribute to the body for the currently active tour name Add data attribute to the body for the currently active tour name and current step Oct 25, 2018
@BrianSipple
Copy link
Contributor Author

@rwwagner90 @chuckcarpenter Since tours currently don't have a name or id property, I'm curious about your thoughts regarding how exactly we could design this.

One approach would be to allow for a name option to be passed to the Tour constructor, and then have the constructor set it as an instance property. If name isn't passed, Shepherd could generate a unique identifier for the Tour and use that.

From there, Tour._setupActiveTour could do something like this:

    document.body.setAttribute('data-shepherd-active-tour', this._name);

@RobbieTheWagner
Copy link
Member

@BrianSipple I believe that is how id was supposed to work, but as Chuck noticed, it was always undefined. Perhaps we were not passing the right params to get it set, but I think your approach sounds good.

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

No branches or pull requests

2 participants