Skip to content

Commit

Permalink
add option for disabling filetype warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nickforddev committed Mar 15, 2020
1 parent 4620361 commit 532fe17
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
13 changes: 11 additions & 2 deletions packages/freezeframe/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ logo.toggle(); // toggle animation

Whether or not to make the image responsive (100% width)

- ### ```warnings```

<code><b>type:</b> boolean</code>
<code><b>default</b>: true</code>

Whether or not to `console.warn` if image doesn't appear to be a gif. When using gifs that don't end in `.gif`, or animated pngs, you may want to disable these.

## Constructor

- ### ```Freezeframe(options)```
Expand All @@ -172,14 +179,16 @@ logo.toggle(); // toggle animation
selector: '.foo',
trigger: 'click',
overlay: true,
responsive: false
responsive: false,
warnings: false
});

// Also valid syntax
new Freezeframe('.foo', {
trigger: 'click',
overlay: true,
responsive: false
responsive: false,
warnings: false
});
```

Expand Down
3 changes: 2 additions & 1 deletion packages/freezeframe/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export const classes = {
export const defaultOptions = {
responsive: true,
trigger: 'hover',
overlay: false
overlay: false,
warnings: true
};

export const events = {
Expand Down
2 changes: 1 addition & 1 deletion packages/freezeframe/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Freezeframe {
normalizeElements,
validateElements,
dedupeImages
)(selectorOrNodes);
)(selectorOrNodes, this.options);
}

_load($images) {
Expand Down

0 comments on commit 532fe17

Please sign in to comment.