Skip to content

Commit 097a987

Browse files
author
alexander.farkas
committed
4.0.0-RC1
1 parent f86b4cd commit 097a987

27 files changed

+40
-27
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
### 4.0.0-RC1
4+
* make all plugins CommonJS compatible (thx to @claudiobmgrtnr and @jantimon)
5+
* added `loadHidden` option(thx to @justinvoelker)
6+
* added artdirection plugin (no documentation yet, but great)
7+
* iOS 8.1 fixes has to loaded explicitly (not included in respimg plugin anymore)
8+
* removed `picture` support for old FF 38-
9+
310
## 2.0.0
411

512
* lazysizes core:

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ Here the list of options:
319319
* ``lazySizesConfig.srcsetAttr`` (default: ``"data-srcset"``): The attribute, which should be transformed to ``srcset``.
320320
* ``lazySizesConfig.sizesAttr`` (default: ``"data-sizes"``): The attribute, which should be transformed to ``sizes``. Makes almost only makes sense with the value ``"auto"``. Otherwise the ``sizes`` attribute should be used directly.
321321
* ``lazySizesConfig.customMedia`` (default: ``{}``): The ``customMedia`` option object is an alias map for different media queries. It can be used to separate/centralize your multiple specific media queries implementation (layout) from the ``source[media]`` attribute (content/structure) by creating labeled media queries. (See also the [custommedia extension](plugins/custommedia)).
322+
* ``lazySizesConfig.loadHidden`` (default: ``true``): Wether to load `visibility: hidden` elements.
322323
```html
323324
<script>
324325
window.lazySizesConfig = window.lazySizesConfig || {};

lazysizes-umd.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@
346346
(eLright = rect.right) >= elemNegativeExpand * hFac &&
347347
(eLleft = rect.left) <= eLvW &&
348348
(eLbottom || eLright || eLleft || eLtop) &&
349+
(lazySizesConfig.loadHidden || getCSS(lazyloadElems[i], 'visibility') != 'hidden') &&
349350
((isCompleted && isLoading < 3 && !elemExpandVal && (loadMode < 3 || lowRuns < 4)) || isNestedVisible(lazyloadElems[i], elemExpand))){
350351
unveilElement(lazyloadElems[i]);
351352
loadedSomething = true;
@@ -655,7 +656,8 @@
655656
init: true,
656657
expFactor: 1.5,
657658
hFac: 0.8,
658-
loadMode: 2
659+
loadMode: 2,
660+
loadHidden: true,
659661
};
660662

661663
lazySizesConfig = window.lazySizesConfig || window.lazysizesConfig || {};

lazysizes-umd.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lazysizes.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@
343343
(eLright = rect.right) >= elemNegativeExpand * hFac &&
344344
(eLleft = rect.left) <= eLvW &&
345345
(eLbottom || eLright || eLleft || eLtop) &&
346+
(lazySizesConfig.loadHidden || getCSS(lazyloadElems[i], 'visibility') != 'hidden') &&
346347
((isCompleted && isLoading < 3 && !elemExpandVal && (loadMode < 3 || lowRuns < 4)) || isNestedVisible(lazyloadElems[i], elemExpand))){
347348
unveilElement(lazyloadElems[i]);
348349
loadedSomething = true;
@@ -652,7 +653,8 @@
652653
init: true,
653654
expFactor: 1.5,
654655
hFac: 0.8,
655-
loadMode: 2
656+
loadMode: 2,
657+
loadHidden: true,
656658
};
657659

658660
lazySizesConfig = window.lazySizesConfig || window.lazysizesConfig || {};

0 commit comments

Comments
 (0)