relative path of the edited file as important part of the context at the

top of the page...
This commit is contained in:
Marcell Mars 2021-04-28 17:35:46 +02:00
parent 2ddbaa42cb
commit 161465ddd7
3 changed files with 10 additions and 4 deletions

View File

@ -91,7 +91,7 @@
<svelte:window on:keyup={keyUp}/>
<main id="sandpoints">
<form>
<SpTitle title={title} />
<SpTitle relpath={relpath} title={title} />
<SpHasWhat on:hasTiersSelected={newHasTiers} hases={hases} hastiers={hastiers} />
<SpHasTiers on:addToCandidatesRemoveFromTiers={addToCandidatesRemoveFromTiers} hastiers={hastiers} candidates={candidates} tiers={tiers}/>
<SpHasCandidates on:addToTiersRemoveFromCandidates={addToTiersRemoveFromCandidates} candidates={candidates} />

View File

@ -7,16 +7,18 @@
const dispatch = createEventDispatcher();
afterUpdate(() => {
let optsel = document.getElementById(hasNew)
let optsel = document.getElementById('hasNew')
if (hastiers=="" && optsel) {
optsel.selected = 'selected';
optsel.disabled = 'disabled'
} else if (hastiers != "") {
let optsel = document.getElementById('_' + hastiers)
optsel.selected = 'selected'
}
});
$: {
$: {
console.log("hases", hases)
if (value && value.startsWith("_")) {
dispatch("hasTiersSelected", value)
}
@ -24,7 +26,9 @@ $: {
</script>
<select id="selecthas" class="selecthas" bind:value>
<option id="hasNew" title="Has new" value="hasNew">Has new...</option>
{#if hastiers == ""}
<option id="hasNew" title="Has new" value="hasNew">Has new...</option>
{/if}
{#each hases as has}
<option id="{'_' + has}" class="hasoption" title="{has}" value={'_' + has}>Has {has}:</option>
{/each}

View File

@ -1,6 +1,8 @@
<script>
export let title;
export let relpath;
</script>
<p><em>File path: <strong>{relpath}</strong></em></p>
<label for="title">Title:</label>
<input type="text" name="title" value="{title}">