@onsvisual/svelte-components 0.1.7 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
* Binding: Current section index (number)
|
|
111
111
|
* @type {number}
|
|
112
112
|
*/
|
|
113
|
-
export let index =
|
|
113
|
+
export let index = null;
|
|
114
114
|
/**
|
|
115
115
|
* Binding: Current section id, if it has one set
|
|
116
116
|
* @type {string}
|
|
@@ -223,7 +223,7 @@
|
|
|
223
223
|
|
|
224
224
|
offset = (threshold_px - top) / (bottom - top);
|
|
225
225
|
if (bottom >= threshold_px) {
|
|
226
|
-
if (index !== i
|
|
226
|
+
if (index !== i) {
|
|
227
227
|
index = i;
|
|
228
228
|
sectionId = section.dataset.id ? section.dataset.id : null;
|
|
229
229
|
dispatch("change", { id, index, sectionId });
|
|
@@ -232,7 +232,10 @@
|
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
if (entered)
|
|
235
|
+
if (entered) {
|
|
236
|
+
dispatch("enter", { id, index, sectionId });
|
|
237
|
+
dispatch("change", { id, index, sectionId });
|
|
238
|
+
}
|
|
236
239
|
if (exited) dispatch("exit", { id, index, sectionId });
|
|
237
240
|
}
|
|
238
241
|
</script>
|