Skip to content

Commit

Permalink
Add button to create new set
Browse files Browse the repository at this point in the history
  • Loading branch information
aiden2480 committed Mar 7, 2022
1 parent 4b93702 commit 52a80e1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,12 @@ function editSetKanji(id, kanji) {

// Create kanji set nodes
generateKanjiSets();

// Event listeners
document.getElementById("createset").addEventListener("click", async () => {
await createSet(prompt("Unit name:"), prompt("Kanji in unit:")).then(() => {
generateKanjiSets();
}).catch(err => {
alert(err);
});
});
2 changes: 2 additions & 0 deletions settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ <h2>Kanji sets</h2>
<div id="setscontainer">
<!-- Dynamically generated -->
</div>

<input type="button" value="Create new unit" id="createset">
</body>

0 comments on commit 52a80e1

Please sign in to comment.