Skip to content

Commit

Permalink
these too
Browse files Browse the repository at this point in the history
  • Loading branch information
thednp committed Oct 28, 2024
1 parent 210390b commit a5610d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![NPM Version](https://img.shields.io/npm/v/bootstrap.native.svg)](https://www.npmjs.com/package/bootstrap.native)
[![jsDeliver](https://img.shields.io/jsdelivr/npm/hw/bootstrap.native)](https://www.jsdelivr.com/package/npm/bootstrap.native)
[![typescript version](https://img.shields.io/badge/typescript-5.6.3-brightgreen)](https://www.typescriptlang.org/)
[![vitest version](https://img.shields.io/badge/vitest-2.1.3-brightgreen)](https://vitest.dev/)
[![vitest version](https://img.shields.io/badge/vitest-2.1.4-brightgreen)](https://vitest.dev/)
[![vite version](https://img.shields.io/badge/vite-5.4.10-brightgreen)](https://vitejs.dev/)


Expand Down
11 changes: 6 additions & 5 deletions src/components/scrollspy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,13 @@ const updateSpyTargets = (self: ScrollSpy) => {
* @param self the ScrollSpy instance
* @param add when `true`, listener is added
*/
const toggleObservers = ({ targets, scrollTarget, element, _observer }: ScrollSpy, add?: boolean) => {
const toggleObservers = (
{ targets, scrollTarget, element, _observer }: ScrollSpy,
add?: boolean,
) => {
if (add) {
if (scrollTarget === element) {
targets.forEach((targetItem) =>
_observer.observe(targetItem)
);
targets.forEach((targetItem) => _observer.observe(targetItem));
} else {
_observer.observe(element);
}
Expand All @@ -136,7 +137,7 @@ const toggleObservers = ({ targets, scrollTarget, element, _observer }: ScrollSp
* @return `scrollTarget` height
*/
const getScrollHeight = (scrollTarget: HTMLElement) => {
return scrollTarget.scrollHeight
return scrollTarget.scrollHeight;
};

/**
Expand Down

0 comments on commit a5610d2

Please sign in to comment.