Skip to content

Commit

Permalink
unicode-analyzer: Implement unpinning
Browse files Browse the repository at this point in the history
  • Loading branch information
eliandoran committed Jul 9, 2024
1 parent 564af65 commit 94512cb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/routes/unicode-analyzer/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,13 @@ Combining diacritical marks: \u0300\u0301\u0302\u0303\u0304\u0305\u0306\u0307\u0
const targetEl = e.target;
if (!targetEl) { return; }
pinnedCode = targetEl.dataset.code;
const newCode = parseInt(targetEl.dataset.code, 10);
if (newCode !== pinnedCode) {
pinnedCode = newCode;
} else {
pinnedCode = null;
}
}
$: {
Expand Down Expand Up @@ -71,7 +77,7 @@ Combining diacritical marks: \u0300\u0301\u0302\u0303\u0304\u0305\u0306\u0307\u0
{:else}
<span class="character special"
class:background={!character.noBackground}
class:pinned={character.code == pinnedCode}
class:pinned={character.code === pinnedCode}
on:click={onClick}
data-code={character.code}>{character.symbol}</span>{character.insertAfter || ""}
{/if}
Expand Down

0 comments on commit 94512cb

Please sign in to comment.