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

getOptions > refactor code for reuse through multiple ESLibs #10

Merged
merged 5 commits into from
Jan 13, 2023
Merged

getOptions > refactor code for reuse through multiple ESLibs #10

merged 5 commits into from
Jan 13, 2023

Conversation

vuquangpham
Copy link
Contributor

@vuquangpham vuquangpham commented Jan 4, 2023

Write the same getOptions function for making our code reusable and using through multiple ES Libraries (or any library that needs to get options from data-attribute) :

With the new getOptions function, we can get options and override them for each library option through data-attribute

@vuquangpham
Copy link
Contributor Author

I have forked this repository and created PR from it. So I can't set the assignee or reviewer for this PR. Sorry about that!

@phucbm phucbm self-requested a review January 5, 2023 07:39
@phucbm phucbm added the enhancement New feature or request label Jan 5, 2023
@vuquangpham vuquangpham changed the base branch from master to 4.0.2 January 5, 2023 07:46
Copy link
Member

@phucbm phucbm left a comment

Choose a reason for hiding this comment

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

Make sure getOptions is identical to the merged version from Easy Tab Accordion.

src/helpers.js Outdated
Comment on lines 25 to 30
if(attributeIsNotJSON){
options = defaultOptions;

// data attribute exist => string
if(dataAttribute) options.id = dataAttribute;
else options.id = '';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added a small condition to remove the id from default options (for getting the id with the right priority below purpose).

Copy link
Member

@phucbm phucbm left a comment

Choose a reason for hiding this comment

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

LGTM.

@phucbm phucbm merged commit e1b2136 into viivue:4.0.2 Jan 13, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants