Skip to content

Commit

Permalink
fix: only check if overflowing when collapsed
Browse files Browse the repository at this point in the history
  • Loading branch information
janbritz committed Jun 27, 2024
1 parent 9957d9c commit 59ce5b2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion amd/build/showmore.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion amd/build/showmore.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion amd/src/showmore.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ export const init = (id) => {
const button = element.querySelector(".qpy-show-more-button");

window.addEventListener("resize", () => {
button.classList.toggle("d-none", !isOverflowing(container));
if (button.classList.contains("collapsed")) {
button.classList.toggle("d-none", !isOverflowing(container));
}
});

button.classList.toggle("d-none", !isOverflowing(container));
Expand Down

0 comments on commit 59ce5b2

Please sign in to comment.