Skip to content

Commit

Permalink
Merge pull request #55 from viivue/2.3.0-fix-active-class-not-customi…
Browse files Browse the repository at this point in the history
…zable

fix active class not customizable
  • Loading branch information
phucbm authored Sep 29, 2023
2 parents 9a3154b + 5c4f4aa commit 4572591
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/helpers.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {arrayUnique} from "./utils";
import {CLASSES, ATTRS} from './configs'

/**
* Has valid id
Expand Down Expand Up @@ -166,8 +165,8 @@ export function removeActiveClass(context, id){
const {current, currentTrigger} = getElements(context, id);

// update classes
current.forEach(item => item.classList.remove(CLASSES.active));
currentTrigger.forEach(item => item.classList.remove(CLASSES.active));
current.forEach(item => item.classList.remove(context.options.activeClass));
currentTrigger.forEach(item => item.classList.remove(context.options.activeClass));
}


Expand All @@ -181,8 +180,8 @@ export function addActiveClass(context, id){
const {current, currentTrigger} = getElements(context, id ? id : context.current_id);

// update classes
if(current) current.forEach(item => item.classList.add(CLASSES.active));
if(currentTrigger) currentTrigger.forEach(item => item.classList.add(CLASSES.active));
if(current) current.forEach(item => item.classList.add(context.options.activeClass));
if(currentTrigger) currentTrigger.forEach(item => item.classList.add(context.options.activeClass));
}

export function log(context, status, ...message){
Expand Down

0 comments on commit 4572591

Please sign in to comment.