Skip to content

Commit

Permalink
active classname
Browse files Browse the repository at this point in the history
  • Loading branch information
binrysearch committed Jun 15, 2024
1 parent 92d6da0 commit 8fed9d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/packages/tour/classNames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ export const dontShowAgainClassName = "introjs-dontShowAgain";
export const hiddenButtonClassName = "introjs-hidden";
export const disabledButtonClassName = "introjs-disabled";
export const fullButtonClassName = "introjs-fullbutton";
export const activeClassName = "active";
7 changes: 4 additions & 3 deletions src/packages/tour/showElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import createElement from "../../util/createElement";
import setStyle from "../../util/setStyle";
import appendChild from "../../util/appendChild";
import {
activeClassName,
arrowClassName,
bulletsClassName,
disabledButtonClassName,
Expand Down Expand Up @@ -110,7 +111,7 @@ function _createBullets(tour: Tour, step: TourStep): HTMLElement {
anchorLink.onclick = anchorClick;

if (i === step.step - 1) {
addClass(anchorLink, "active");
addClass(anchorLink, activeClassName);
}

setAnchorAsButton(anchorLink);
Expand Down Expand Up @@ -150,7 +151,7 @@ function _updateBullets(
) {
if (showBullets) {
const oldRefActiveBullet = queryElement(
`.${bulletsClassName} li > a.active`,
`.${bulletsClassName} li > a.${activeClassName}`,
oldReferenceLayer
);

Expand All @@ -161,7 +162,7 @@ function _updateBullets(

if (oldRefActiveBullet && oldRefBulletStepNumber) {
oldRefActiveBullet.className = "";
addClass(oldRefBulletStepNumber, "active");
addClass(oldRefBulletStepNumber, activeClassName);
}
}
}
Expand Down

0 comments on commit 8fed9d4

Please sign in to comment.