Skip to content

Commit

Permalink
Merge branch 'hotfix/12.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Verlicchi committed Feb 27, 2020
2 parents 5500b78 + f52fb0a commit 74de2f6
Show file tree
Hide file tree
Showing 15 changed files with 73 additions and 144 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Version 12

#### 12.5.1

Restored IE 11 compatibility, which was broken since 12.2.0. See #414.
Thanks to @ninosaurus for reporting.

#### 12.5.0

The once-private `_loadingCount` property is now public and renamed to `loadingCount`. This property contains the number of images that are currently downloading from the network, limitedly to the ones managed by an instance of LazyLoad. This is particularly useful to understand whether or not is safe to destroy an instance of LazyLoad. See implementation in the [destroy demo](demos/destroy.html).
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Please note that the video poster can be lazily loaded too.

## 👩‍💻 Getting started - Script

The latest, recommended version of LazyLoad is **12.5.0**.
The latest, recommended version of LazyLoad is **12.5.1**.

### To polyfill or not to polyfill IntersectionObserver?

Expand All @@ -128,14 +128,14 @@ If you prefer to load a polyfill, the regular LazyLoad behaviour is granted.
The easiest way to use LazyLoad is to include the script from a CDN:

```html
<script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@12.5.0/dist/lazyload.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@12.5.1/dist/lazyload.min.js"></script>
```

Or, with the IntersectionObserver polyfill:

```html
<script src="https://cdn.jsdelivr.net/npm/intersection-observer@0.7.0/intersection-observer.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@12.5.0/dist/lazyload.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@12.5.1/dist/lazyload.min.js"></script>
```

Then, in your javascript code:
Expand Down Expand Up @@ -168,7 +168,7 @@ Include RequireJS:
Then `require` the AMD version of LazyLoad, like this:

```js
var lazyLoadAmdUrl = "https://cdn.jsdelivr.net/npm/vanilla-lazyload@12.5.0/dist/lazyload.amd.min.js";
var lazyLoadAmdUrl = "https://cdn.jsdelivr.net/npm/vanilla-lazyload@12.5.1/dist/lazyload.amd.min.js";
var polyfillAmdUrl = "https://cdn.jsdelivr.net/npm/intersection-observer-amd@2.1.0/intersection-observer-amd.js";

/// Dynamically define the dependencies
Expand Down Expand Up @@ -214,7 +214,7 @@ Then include the script.
```html
<script
async
src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@12.5.0/dist/lazyload.min.js"
src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@12.5.1/dist/lazyload.min.js"
></script>
```
Expand Down Expand Up @@ -247,7 +247,7 @@ Then include the script.
```html
<script
async
src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@12.5.0/dist/lazyload.min.js"
src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@12.5.1/dist/lazyload.min.js"
></script>
```
Expand Down
12 changes: 1 addition & 11 deletions dist/lazyload.amd.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }

function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }

function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }

function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

define(function () {
Expand Down Expand Up @@ -453,12 +445,10 @@ define(function () {
var retryLazyLoad = function retryLazyLoad(instance) {
var settings = instance._settings;
var errorElements = settings.container.querySelectorAll("." + settings.class_error);

_toConsumableArray(errorElements).forEach(function (element) {
errorElements.forEach(function (element) {
removeClass(element, settings.class_error);
resetWasProcessedData(element);
});

instance.update();
};

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.

2 changes: 1 addition & 1 deletion dist/lazyload.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ const retryLazyLoad = instance => {
var errorElements = settings.container.querySelectorAll(
"." + settings.class_error
);
[...errorElements].forEach(element => {
errorElements.forEach(element => {
removeClass(element, settings.class_error);
resetWasProcessedData(element);
});
Expand Down
12 changes: 1 addition & 11 deletions dist/lazyload.iife.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }

function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }

function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }

function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

var LazyLoad = function () {
Expand Down Expand Up @@ -453,12 +445,10 @@ var LazyLoad = function () {
var retryLazyLoad = function retryLazyLoad(instance) {
var settings = instance._settings;
var errorElements = settings.container.querySelectorAll("." + settings.class_error);

_toConsumableArray(errorElements).forEach(function (element) {
errorElements.forEach(function (element) {
removeClass(element, settings.class_error);
resetWasProcessedData(element);
});

instance.update();
};

Expand Down
Loading

0 comments on commit 74de2f6

Please sign in to comment.