Skip to content

Commit

Permalink
Merge branch 'release/11.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
verlok committed Feb 24, 2019
2 parents a3cbedf + 2f8bbd6 commit b84f28e
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 32 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Version 11

#### 11.0.2

Applied a patch to resolve #293 a [Chromium bug](https://bugs.chromium.org/p/chromium/issues/detail?id=910741#c13) already fixed in Chrome 72. Thanks to @dverbovyi for reporting, analyzing and solving it.

#### 11.0.1

Squashed a nasty bug that occurred on IE 11 and Safari when the `IntersectionObserver` polyfill wasn't loaded before LazyLoad.
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ Note that to load images you to use `url()` in the value of your `data-bg` attri

### Include LazyLoad in your project

The latest version of LazyLoad is **11.0.1**.<br>
The latest version of LazyLoad is **11.0.2**.<br>
&rarr; [Read the note about versions and behaviour](#note-about-versions-and-behaviour)

#### The simplest way

The easiest way to use LazyLoad is to include the script from a CDN:

```html
<script src="https://cdn.jsdelivr.net/npm/[email protected].1/dist/lazyload.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected].2/dist/lazyload.min.js"></script>
```

Then, in your javascript code:
Expand Down Expand Up @@ -137,7 +137,7 @@ If you prefer, it's possible to include LazyLoad's script using `async` script a
Then include the script.

```html
<script async src="https://cdn.jsdelivr.net/npm/[email protected].1/dist/lazyload.min.js"></script>
<script async src="https://cdn.jsdelivr.net/npm/[email protected].2/dist/lazyload.min.js"></script>
```

**Possibly place the script tag right before the closing `</body>` tag**. If you can't do that, LazyLoad could be executed before the browser has loaded all the DOM, and you'll need to call `lazyLoadInstance.update();` to make LazyLoad check the DOM again.
Expand Down Expand Up @@ -177,7 +177,7 @@ This is because LazyLoad uses `CustomEvent` ([learn more](https://developer.mozi
If you use [RequireJS](https://requirejs.org) to dynamically load modules in your website, you can take advantage of it.

```js
define("vanilla-lazyLoad", ["https://cdn.jsdelivr.net/npm/[email protected].1/dist/lazyload.amd.min.js"], function (LazyLoad) {
define("vanilla-lazyLoad", ["https://cdn.jsdelivr.net/npm/[email protected].2/dist/lazyload.amd.min.js"], function (LazyLoad) {
return LazyLoad;
});
```
Expand Down Expand Up @@ -239,7 +239,7 @@ Inside the `dist` folder you will find different bundles.

#### Note about versions and behaviour

The latest, recommended version of LazyLoad is `11.0.1`.
The latest, recommended version of LazyLoad is `11.0.2`.

- On [browsers supporting the `IntersectionObserver` API]((https://caniuse.com/#feat=intersectionobserver)), it will load your images as they enter the viewport.
- On browsers _not_ supporting `IntersectionObserver`, it will load all your lazy content immediately, **unless** you load an `IntersectionObserver` polyfill like [this one](https://github.com/w3c/IntersectionObserver/) in your page (before LazyLoad). Using [Polyfill.io](https://polyfill.io/) is a way to do that.
Expand Down
5 changes: 1 addition & 4 deletions dist/lazyload.amd.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,9 @@ define(function () {
setWasProcessedData(element);
callbackIfSet(settings.callback_reveal, element);
};
/* entry.isIntersecting needs fallback because is null on some versions of MS Edge, and
entry.intersectionRatio is not enough alone because it could be 0 on some intersecting elements */


var isIntersecting = function isIntersecting(entry) {
return entry.isIntersecting || entry.intersectionRatio > 0;
return entry.intersectionRatio > 0;
};

var getObserverSettings = function getObserverSettings(settings) {
Expand Down
2 changes: 1 addition & 1 deletion dist/lazyload.amd.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 dist/lazyload.amd.min.js.map

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions dist/lazyload.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,7 @@ const revealElement = (element, instance, force) => {
callbackIfSet(settings.callback_reveal, element);
};

/* entry.isIntersecting needs fallback because is null on some versions of MS Edge, and
entry.intersectionRatio is not enough alone because it could be 0 on some intersecting elements */
const isIntersecting = entry =>
entry.isIntersecting || entry.intersectionRatio > 0;
const isIntersecting = entry => entry.intersectionRatio > 0;

const getObserverSettings = settings => ({
root: settings.container === document ? null : settings.container,
Expand Down
5 changes: 1 addition & 4 deletions dist/lazyload.iife.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,9 @@ var LazyLoad = function () {
setWasProcessedData(element);
callbackIfSet(settings.callback_reveal, element);
};
/* entry.isIntersecting needs fallback because is null on some versions of MS Edge, and
entry.intersectionRatio is not enough alone because it could be 0 on some intersecting elements */


var isIntersecting = function isIntersecting(entry) {
return entry.isIntersecting || entry.intersectionRatio > 0;
return entry.intersectionRatio > 0;
};

var getObserverSettings = function getObserverSettings(settings) {
Expand Down
Loading

0 comments on commit b84f28e

Please sign in to comment.