Skip to content

Commit

Permalink
Move service mark down the page.
Browse files Browse the repository at this point in the history
  • Loading branch information
samwho committed Apr 20, 2024
1 parent 26a065a commit 8ec1323
Showing 1 changed file with 7 additions and 22 deletions.
29 changes: 7 additions & 22 deletions symbols.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,6 @@ const symbols = [
"name": "Trademark",
"searchTerms": ["trademark", "TM"]
},
{
"glyph": "℠",
"name": "Service Mark",
"searchTerms": ["service mark", "SM"]
},
{
"glyph": "“",
"name": "Left Double Quotation Mark",
"searchTerms": ["quotation", "quote", "double", '"']
},
{
"glyph": "”",
"name": "Right Double Quotation Mark",
Expand Down Expand Up @@ -256,7 +246,12 @@ const symbols = [
"glyph": "µ",
"name": "Micro",
"searchTerms": ["micro"],
}
},
{
"glyph": "“",
"name": "Left Double Quotation Mark",
"searchTerms": ["quotation", "quote", "double", '"']
},
]

function renderSymbols(searchTerm) {
Expand All @@ -271,11 +266,9 @@ function renderSymbols(searchTerm) {
}
const elem = document.createElement("div");
elem.classList = "symbol";
elem.tabIndex = 0;
elem.textContent = symbolInfo.display || symbolInfo.glyph;
elem.title = symbolInfo.name;

const handleAction = () => {
elem.addEventListener("click", () => {
if (elem.classList.contains("symbol-clicked")) return;

navigator.clipboard.writeText(symbolInfo.glyph);
Expand All @@ -290,14 +283,6 @@ function renderSymbols(searchTerm) {
elem.classList.remove("symbol-clicked");
elem.classList.add("symbol");
}, 1000);
}
elem.addEventListener("click", handleAction);

elem.addEventListener("keydown", (event) => {
if (event.key === "Enter" || event.key === " ") {
event.preventDefault();
handleAction();
}
});
parent.appendChild(elem);
}
Expand Down

0 comments on commit 8ec1323

Please sign in to comment.