Skip to content

Commit ca7aca3

Browse files
committed
optmize
1 parent eed55cb commit ca7aca3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

frontend/src/ts/test/break-ligatures.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Config from "../config";
2-
import { ElementWithUtils, qsr } from "../utils/dom";
2+
import { ElementWithUtils } from "../utils/dom";
33

44
export function set(
55
wordEl: ElementWithUtils,
@@ -11,8 +11,10 @@ export function set(
1111
return;
1212
}
1313

14-
const wordsEl = qsr("#words");
15-
if (Config.typedEffect === "dots" && wordsEl.hasClass("withLigatures")) {
14+
if (Config.typedEffect !== "dots") return;
15+
16+
const parent = wordEl.native.parentElement;
17+
if (parent?.classList.contains("withLigatures")) {
1618
const width = wordEl.native.getBoundingClientRect().width;
1719
wordEl.setStyle({ width: `${width}px` });
1820
wordEl.addClass("broken-ligatures");

0 commit comments

Comments
 (0)