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 JS for anchor link to open tab #86

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

richardteng-dev
Copy link

No description provided.

Copy link
Member

Choose a reason for hiding this comment

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

I wonder if this would be better attached to the template? We could use {{ attach_library('ubc_paragraph_entities/[libraryname]') }} in the tabcordion paragraph template instead, ensuring it only gets loaded when there's a tabcordion.

Copy link
Author

Choose a reason for hiding this comment

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

library attached to twig template. Removed from module file.

Copy link
Member

Choose a reason for hiding this comment

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

I think the library name would be better as tabcordion_anchor or something similar. That way, if we have to add others, this is specific to the one js file.

Also, I don't see you using once in the js (but it does load jQuery even though it's never used), so once should probably be removed from the dependencies, or, ideally, we refactor the js to use it (to prevent the javascript from firing twice on Ajax calls).

Copy link
Author

Choose a reason for hiding this comment

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

Library name updated. JS refactored to use once.

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

Successfully merging this pull request may close these issues.

2 participants