-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
Refactor js with once. Update method to attach library
No description provided.