svelte-lazy
Advanced tools
Comparing version 1.0.0 to 1.0.1
16
index.js
@@ -736,4 +736,4 @@ (function (global, factory) { | ||
var style = element("style"); | ||
style.id = "svelte-12yo691-style"; | ||
style.textContent = ".hide.svelte-12yo691{display:none}.show.svelte-12yo691{display:block}"; | ||
style.id = "svelte-u9r2nm-style"; | ||
style.textContent = ".hide.svelte-u9r2nm{display:none}"; | ||
append(document_1.head, style); | ||
@@ -799,3 +799,3 @@ } | ||
if_block_anchor = empty(); | ||
attr(div, "class", div_class_value = "" + (null_to_empty(/*contentClass*/ ctx[4]) + " svelte-12yo691")); | ||
attr(div, "class", div_class_value = "" + (null_to_empty(/*contentClass*/ ctx[4]) + " svelte-u9r2nm")); | ||
}, | ||
@@ -821,3 +821,3 @@ m(target, anchor) { | ||
if (!current || dirty & /*contentClass*/ 16 && div_class_value !== (div_class_value = "" + (null_to_empty(/*contentClass*/ ctx[4]) + " svelte-12yo691"))) { | ||
if (!current || dirty & /*contentClass*/ 16 && div_class_value !== (div_class_value = "" + (null_to_empty(/*contentClass*/ ctx[4]) + " svelte-u9r2nm"))) { | ||
attr(div, "class", div_class_value); | ||
@@ -956,3 +956,3 @@ } | ||
if_block.c(); | ||
attr(div, "class", div_class_value = "" + (null_to_empty(/*rootClass*/ ctx[5]) + " svelte-12yo691")); | ||
attr(div, "class", div_class_value = "" + (null_to_empty(/*rootClass*/ ctx[5]) + " svelte-u9r2nm")); | ||
}, | ||
@@ -1143,3 +1143,3 @@ m(target, anchor) { | ||
() => { | ||
$$invalidate(2, contentDisplay = "show"); | ||
$$invalidate(2, contentDisplay = ""); | ||
node.style.height = "auto"; | ||
@@ -1154,3 +1154,3 @@ }, | ||
// Keep height if there is error | ||
$$invalidate(2, contentDisplay = "show"); | ||
$$invalidate(2, contentDisplay = ""); | ||
}, | ||
@@ -1212,3 +1212,3 @@ { capture: true, once: true } | ||
super(); | ||
if (!document_1.getElementById("svelte-12yo691-style")) add_css(); | ||
if (!document_1.getElementById("svelte-u9r2nm-style")) add_css(); | ||
@@ -1215,0 +1215,0 @@ init(this, options, instance$1, create_fragment$1, safe_not_equal, { |
@@ -6,3 +6,3 @@ { | ||
"main": "index.js", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"repository": "leafOfTree/svelte-lazy", | ||
@@ -9,0 +9,0 @@ "scripts": { |
@@ -23,3 +23,3 @@ # svelte-lazy [![Build Status][1]][2] [![npm version][3]][4] | ||
<Lazy height={300} offset={150}> | ||
<Lazy height={300}> | ||
<img alt="" src="https://picsum.photos/id/412/200/300" /> | ||
@@ -31,3 +31,3 @@ </Lazy> | ||
- `height: Number|String` Default: `0`. Height of the placeholder before the component is loaded. Set a proper value to avoid scroll bounce. | ||
- `height: Number|String` Default: `0`. Height of the placeholder before the component is loaded. **Set a proper value** to avoid scroll bounce. | ||
@@ -50,3 +50,3 @@ - `offset: Number` Default: `150`. Offset to the bottom of viewport that triggers loading when the component is in the scope. | ||
v0 -> v1 | ||
v0 -> v1.0 | ||
@@ -59,7 +59,7 @@ - Adjust dom structure | ||
``` | ||
in viewport / no image -> loaded | ||
not loaded ------------------> | ||
\ with image -> load event -> loaded | ||
| | ||
show placeholder | show content | ||
in viewport / no image -> loaded | ||
not loaded ---------------> | ||
\ with image -> load event -> loaded | ||
| | ||
show placeholder | show content | ||
``` | ||
@@ -66,0 +66,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
76074