mirror of
https://github.com/wukko/cobalt.git
synced 2025-04-29 22:14:26 +02:00
web/SettingsDropdown: add haptics
This commit is contained in:
parent
ef7fc8781b
commit
6e21fc56eb
@ -8,6 +8,7 @@
|
||||
import { updateSetting } from "$lib/state/settings";
|
||||
import type { CobaltSettings } from "$lib/types/settings";
|
||||
|
||||
import { hapticConfirm, hapticSwitch } from "$lib/haptics";
|
||||
import IconSelector from "@tabler/icons-svelte/IconSelector.svelte";
|
||||
|
||||
export let title: string;
|
||||
@ -22,8 +23,9 @@
|
||||
export let disabled = false;
|
||||
|
||||
const onChange = (event: Event) => {
|
||||
const target = event.target as HTMLSelectElement;
|
||||
hapticConfirm();
|
||||
|
||||
const target = event.target as HTMLSelectElement;
|
||||
updateSetting({
|
||||
[settingContext]: {
|
||||
[settingId]: target.value,
|
||||
@ -46,13 +48,17 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<select on:change={e => onChange(e)} {disabled}>
|
||||
<select
|
||||
on:click={() => hapticSwitch()}
|
||||
on:change={(e) => onChange(e)}
|
||||
{disabled}
|
||||
>
|
||||
{#each Object.keys(items) as value, i}
|
||||
<option {value} selected={selectedOption === value}>
|
||||
{items[value]}
|
||||
</option>
|
||||
{#if i === 0}
|
||||
<hr>
|
||||
<hr />
|
||||
{/if}
|
||||
{/each}
|
||||
</select>
|
||||
|
Loading…
x
Reference in New Issue
Block a user