svelte-log-view 5.0.0 → 5.1.0
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.
- package/package.json +1 -1
- package/src/LogView.svelte +8 -7
package/package.json
CHANGED
package/src/LogView.svelte
CHANGED
|
@@ -12,10 +12,7 @@
|
|
|
12
12
|
let content;
|
|
13
13
|
|
|
14
14
|
onDestroy(() => source.abort());
|
|
15
|
-
|
|
16
|
-
onMount(async () => {
|
|
17
|
-
fetchFollow();
|
|
18
|
-
});
|
|
15
|
+
onMount(() => fetchFollow());
|
|
19
16
|
|
|
20
17
|
async function fetchFollow() {
|
|
21
18
|
let current;
|
|
@@ -98,7 +95,7 @@
|
|
|
98
95
|
follow = flag;
|
|
99
96
|
}
|
|
100
97
|
|
|
101
|
-
function
|
|
98
|
+
function onkeydown(event) {
|
|
102
99
|
switch (event.key) {
|
|
103
100
|
case "ArrowUp":
|
|
104
101
|
setFollow(false);
|
|
@@ -130,12 +127,16 @@
|
|
|
130
127
|
break;
|
|
131
128
|
}
|
|
132
129
|
}
|
|
130
|
+
|
|
131
|
+
function onclick(event) {
|
|
132
|
+
setSelected(start + Math.floor(event.clientY / 21)); // TODO calculate position ?
|
|
133
|
+
}
|
|
133
134
|
</script>
|
|
134
135
|
|
|
135
|
-
<svelte:window onkeydown
|
|
136
|
+
<svelte:window {onkeydown} />
|
|
136
137
|
<log-content bind:this={content}>
|
|
137
138
|
{#each visible as entry, i (i)}
|
|
138
|
-
<log-row>
|
|
139
|
+
<log-row {onclick} {onkeydown} role="none">
|
|
139
140
|
<slot {entry} {selected} position={start + i} />
|
|
140
141
|
</log-row>
|
|
141
142
|
{/each}
|