]> zoso.dev Git - nemo-wallet.git/commitdiff
Move execution of account creation to button listener instead of inline event handler.
authorChris Duncan <chris@zoso.dev>
Wed, 6 Nov 2024 22:27:13 +0000 (14:27 -0800)
committerChris Duncan <chris@zoso.dev>
Wed, 6 Nov 2024 22:27:13 +0000 (14:27 -0800)
nemo-wallet.html

index 9394686d08e7d087bf877bf73c8797626922c126..d03db15fc86550f97fb201dbe144cb75ec8e2dd7 100644 (file)
@@ -11,8 +11,6 @@
        </script>
        <script type="module" src="https://cdn.jsdelivr.net/npm/libnemo@0.0.19/dist/global.min.js"></script>
        <script>
-
-               // let css
                const observer = new MutationObserver((mutations) => {
                        for (const mutation of mutations) {
                                if (mutation.type === "attributes") {
                                        clearStorage()
                                }
                        })
+                       const accountNewOkButton = document.getElementById('account-new-ok-button')
+                       accountNewOkButton.addEventListener('click', (event) => {
+                               if (event.detail === 1) {
+                                       createAccount()
+                               }
+                       })
                        const exportMnemonicButton = document.getElementById('export-mnemonic-button')
                        exportMnemonicButton.addEventListener('click', async (event) => {
                                if (event.detail === 1) {
                                </div>
                                <div class="grid">
                                        <div class="col-3"></div>
-                                       <button id="account-new-cancel" class="cancel col-3" type="reset">Cancel</button>
-                                       <button id="account-new-ok" class="col-3" onclick="createAccount()">OK</button>
+                                       <button id="account-new-cancel-button" class="cancel col-3" type="reset">Cancel</button>
+                                       <button id="account-new-ok-button" class="col-3">OK</button>
                                </div>
                        </div>
                </div>