Skip to content

Commit

Permalink
Make it faster in the UI to flip between test cases. Useful for check…
Browse files Browse the repository at this point in the history
…ing diffs in many places
  • Loading branch information
dabreegster committed Mar 22, 2024
1 parent c603825 commit df08696
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
2 changes: 0 additions & 2 deletions web/src/common/import/Osm2streetsSettings.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script lang="ts">
import LanePopup from "../../street-explorer/LanePopup.svelte";
export let settings = {
debug_each_step: false,
dual_carriageway_experiment: false,
Expand Down
20 changes: 20 additions & 0 deletions web/src/common/osm_input/BuiltInSelector.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,33 @@
testCase = prev;
await reload();
}
async function prev() {
let idx = list.indexOf(testCase);
if (idx != -1 && idx != 0) {
testCase = list[idx - 1];
await reload();
}
}
async function next() {
let idx = list.indexOf(testCase);
if (idx != -1 && idx != list.length - 1) {
testCase = list[idx + 1];
await reload();
}
}
</script>

<button on:click={prev} disabled={testCase == "none"}>&larr;</button>

<select bind:value={testCase} on:change={reload}>
<option value="none">None</option>
{#each list as x}
<option value={x}>{x}</option>
{/each}
</select>

<button on:click={next} disabled={testCase == "none"}>&rarr;</button>

<svelte:window on:popstate={popState} />

0 comments on commit df08696

Please sign in to comment.