Skip to content

Commit

Permalink
Fix for display issue & adding link in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisMBarr committed Jul 27, 2023
1 parent 6f436dc commit 883dae0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Grainy

Makes grainy SVG textures

https://finitelooper.github.io/grainy/
5 changes: 3 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ function $$(multiElSelector) {
function toggleDisplay($elements) {
function t(el) {
const currentDisplay = getComputedStyle(el).display;
if (currentDisplay === 'block') {
if (currentDisplay !== 'none') {
el.attributes['data-prev-display'] = currentDisplay;
el.style.display = 'none';
} else if (currentDisplay === 'none') {
el.style.display = 'block';
el.style.display = el.attributes['data-prev-display'] ?? 'block';
}
}

Expand Down

0 comments on commit 883dae0

Please sign in to comment.