-
Notifications
You must be signed in to change notification settings - Fork 13
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
function initialize changes for language switcher, modal, accordian, biocard and modal #1509
base: develop
Are you sure you want to change the base?
Conversation
Deploying design-system with
|
Latest commit: |
9ec1954
|
Status: | ✅ Deploy successful! |
Preview URL: | https://7dfedffd.design-system.pages.dev |
Branch Preview URL: | https://1499-optimize-js-loading.design-system.pages.dev |
…1499-optimize-js-loading
…sign-system into 1499-optimize-js-loading
…tialization for tab, PageHero, Carousels and gallery
@@ -9,7 +9,7 @@ export const Accordion = ({ headerText, descriptionText }) => { | |||
// }, []); | |||
|
|||
return ( | |||
<ul className="accordion" aria-label="accordion" data-component="accordion"> | |||
<ul className="accordion" aria-label="accordion" data-undps-component="accordion"> |
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.
@mihir880 , it has to be data-undpds-
prefix (as in UNDP Design System) so it will be mnemonic
stories/assets/js/init-loader.js
Outdated
if (typeof window.UNDP?.langSwitch === 'function') { | ||
window.UNDP.langSwitch(); | ||
} else { | ||
// if (typeof window.UNDP?.langSwitch === 'function') { |
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.
@mihir880 , your original idea was great - to check if the module is already loaded and use it that way, opting for load dynamically only if the function is not present. I'd rather keep it that way to make script more versatile. The only issue you have to resolve is changing window.UNDP.functionName
in the condition to simply functionName
as it is defined in the global scope if loaded as a separate script
No description provided.