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

Neodigm Carousel | getName method #85

Closed
neodigm opened this issue Sep 10, 2023 · 2 comments
Closed

Neodigm Carousel | getName method #85

neodigm opened this issue Sep 10, 2023 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@neodigm
Copy link
Collaborator

neodigm commented Sep 10, 2023

We need to access the name of the current page / panel given a carousel instance id.

From a DX perspective this is a must because otherwise we have hard-coded magic numbers all over the UX logic that must be changed whenever the a new page is inserted.

document.addEventListener("copy", ( ev ) => {
    if( neodigmCarousel.nav({"id":"js-wtt-a2yw-caro__id","nav":"getName"}) == "snippet" ){
        oWTTCompStore.copied = true;
        neodigmCarousel.nav({"id":"js-wtt-a2yw-caro__id","nav":"next"})
    }
} )
@neodigm neodigm added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Sep 10, 2023
@neodigm
Copy link
Collaborator Author

neodigm commented Sep 10, 2023

Note: This should be an easy task.

@neodigm
Copy link
Collaborator Author

neodigm commented Sep 10, 2023

This is complete in v3.1.

case "getName":
  return oState.aTabCntr[ (oState.nIdx - 1) ].dataset?.n55CarouselPageName
break;

@neodigm neodigm closed this as completed Sep 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant