paritybit.ca

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 27bb40fec9949c038acdcfaf120c7f55aa7e06d4
parent 3249e7e7c140e50870472e36bfb2ed03e75144ee
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Mon, 15 Apr 2019 23:19:28 -0400

Re-order initative page and fix issue where Enter key did nothing

Diffstat:
Mpages/projects/dnd/initiative.md | 10++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/pages/projects/dnd/initiative.md b/pages/projects/dnd/initiative.md @@ -11,31 +11,29 @@ what order. With many characters plus many more NPCs it can become difficult to keep track of exactly who's turn it is next. This should help alleviate those problems.</p> -<div class="initiative-list" id="initiative-list"> <div id="add-char"> <form> <input id="char-name" type="text" placeholder="Character Name"></input> <input id="init-val" type="number" placeholder="0"></input> </form> - <button onClick=addChar() id="add-char">Add Character</button> -<button onClick=sortList()>Sort List</button> </div> +<div class="initiative-list" id="initiative-list"> </div> <script> let charInit = document.getElementById("init-val"); - charInput.addEventListener("keyup", (event) => { + charInit.addEventListener("keyup", (event) => { if (event.keyCode === 13) { event.preventDefault(); - document.getElementById("add-char").click(); + addChar(); } }); let charName = document.getElementById("char-name"); charName.addEventListener("keyup", (event) => { if (event.keyCode === 13) { event.preventDefault(); - document.getElementById("add-char").click(); + addChar(); } }); </script>