js-tailwind icon indicating copy to clipboard operation
js-tailwind copied to clipboard

Refactor the initTabs function

Open einazare opened this issue 5 years ago • 0 comments

  • [ ] 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.

einazare avatar May 20 '20 16:05 einazare