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

Improve content options for each step #16

Closed
jwarby opened this issue Jul 31, 2014 · 1 comment
Closed

Improve content options for each step #16

jwarby opened this issue Jul 31, 2014 · 1 comment

Comments

@jwarby
Copy link
Owner

jwarby commented Jul 31, 2014

At present, the content option of each step must be the ID of a DOM element which contains the content to display. This is misleading - this property should be the actual text, which would allow a tour to be fully defined via JSON (except for the available callbacks).

In order to maintain support for using an element's content as the step content, a optional content_selector (or similar) option should be added to each step. This would also require a decision on precedence of these two options, should the developer accidentally (or intentionally) specify both options. A warning should probably be output to the console in this case as well.

@jwarby jwarby added this to the Version 2 milestone Jul 31, 2014
@jwarby jwarby added ready and removed ready labels Aug 7, 2014
@jwarby jwarby self-assigned this Aug 7, 2014
@jwarby
Copy link
Owner Author

jwarby commented Aug 7, 2014

Suggest a different approach here - attempt to treat the existing content parameter as a selector, and perform the following checks:

  • Check if it is a valid selector. If not, use the value as the content value
  • If it is a valid selector, check the length property. If 0, do as above
  • Else, use the content from the matched element

This has a couple of advantages:

  • Non-breaking change
  • Worst-case-scenario is that the content is output as a selector

@jwarby jwarby closed this as completed in dc6df02 Aug 7, 2014
jwarby pushed a commit that referenced this issue Aug 7, 2014
jwarby pushed a commit that referenced this issue Aug 7, 2014
…teral

value is used in the event that the string is not a valid selector, or it does
not match any elements in the DOM - fixes #16 and fixes #26
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

1 participant