js-tailwind
js-tailwind copied to clipboard
Refactor the initTabs function
- [ ] When overriding the deafult classes by calling again the initTabs funtion, another event listener will be added for all the tabs, make this only happen for those overriden tabs
- [ ] Change the active classes object, maybe you will have to change normal classes object as well The issue is that, the following code:
let activeElement = ulElement.querySelector("li > a" + queryActiveClasses);
Has errors if the queryActiveClasses is an array with more than one class:
Example:
queryActiveClasses === [".class-1",".class-2"];
// then
"li > a" + queryActiveClasses === "li > a.class-1,.class-2"
// should be
"li > a" + queryActiveClasses === "li > a.class-1.class-2"
Notice the comma.