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

Change data-id to data-shepherd-step-id on Step content elements. #282

Merged
merged 1 commit into from
Oct 22, 2018

Conversation

BrianSipple
Copy link
Contributor

clashResiliance++;

@BrianSipple BrianSipple force-pushed the change-data-id-attribute-name branch from 46134ec to b019124 Compare October 21, 2018 20:40
@@ -190,7 +190,7 @@ export class Step extends Evented {
_createTooltipContent() {
const content = document.createElement('div');
const classes = this.options.classes || '';
const element = createFromHTML(`<div class='${classes}' data-id='${this.id}' id="step-${this.options.id}-${uniqueId()}"}>`);
const element = createFromHTML(`<div class='${classes}' data-shepherd-step-id='${this.id}' id="step-${this.options.id}-${uniqueId()}"}>`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good w/ removing the ID attr, but since with multiple tours we can have shared ids, can we do something to make sure this value is unique?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chuckcarpenter I think we should have a single data-shepherd-step-id attr that does what id is currently doing.

Is that what you're suggesting?

Copy link
Contributor Author

@BrianSipple BrianSipple Oct 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then again, do we need uniqueness here?

We were discussing having a data-shepherd-active-tour attribute on the body. If we implement that, someone could always use it as the context for querying unique steps -- even if steps share ids across tours.

Copy link
Contributor Author

@BrianSipple BrianSipple Oct 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chuckcarpenter @rwwagner90 To summarize, I'm thinking we merge this PR as-is, then open up another issue for adding data-shepherd-active-tour attribute to the body and removing the extra id attribute on steps.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, we have current tour on the body, so that solves the specificity issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chuckcarpenter Where are you seeing that? I'm thinking we still need to implement it. Right now, it looks like we're just indicating the current step:

screen shot 2018-10-22 at 4 01 26 pm

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right. It's in the BM frontend right now.

// TODO: add this in Shepherd.js
document.body.setAttribute('data-shepherd-active-tour', tourName);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that said, should the tour id be part of the ID for the step?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RobbieTheWagner RobbieTheWagner merged commit 7aa796a into master Oct 22, 2018
@RobbieTheWagner RobbieTheWagner deleted the change-data-id-attribute-name branch October 22, 2018 23:39
BrianSipple added a commit that referenced this pull request Nov 22, 2018
BrianSipple added a commit that referenced this pull request Nov 22, 2018
BrianSipple added a commit that referenced this pull request Nov 22, 2018
BrianSipple added a commit that referenced this pull request Nov 22, 2018
RobbieTheWagner pushed a commit that referenced this pull request Nov 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants