]> git.bitcoin.ninja Git - satsto.me/commitdiff
Fix button disabling, incl on refresh
authorMatt Corallo <git@bluematt.me>
Mon, 15 Jul 2024 23:48:06 +0000 (23:48 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 15 Jul 2024 23:54:51 +0000 (23:54 +0000)
index.html

index 930aa70d58a8bf68ba46623ed680406a7f696c86..6daf593349b4c14d3426c7f532df7bfbec10aac7 100644 (file)
                                        <span class="bitcoin fill-fixed">₿</span>
                                        <input class="fill-use-remaining text-box" type="text" id="address" value="matt@satsto.me"/>
                                        <!-- SVG from bootstrap icons, Copyright (c) 2019-2024 The Bootstrap Authors, MIT License -->
-                                       <svg onclick="lookup_domain()" id="paybutton" xmlns="http://www.w3.org/2000/svg" fill="white" class="go-button fill-fixed" viewBox="0 0 16 16">
+                                       <svg onclick="lookup_domain()" id="paybutton" xmlns="http://www.w3.org/2000/svg" fill="white" class="go-button go-button-disabled fill-fixed" viewBox="0 0 16 16">
                                                <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0M4.5 7.5a.5.5 0 0 0 0 1h5.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3a.5.5 0 0 0 0-.708l-3-3a.5.5 0 1 0-.708.708L10.293 7.5z"/>
                                        </svg>
                                </div>
                                document.getElementById("address").onchange = check_text;
                                document.getElementById("address").onkeypress = check_text;
                                document.getElementById("address").oninput = check_text;
+                               check_text();
                                window.lookup_domain = function() {
+                                       if (document.getElementById("paybutton").classList.contains("go-button-disabled")) {
+                                               return;
+                                       }
                                        const addr_parts = address_box.value.split("@");
                                        var dom = addr_parts[0] + ".user._bitcoin-payment." + addr_parts[1];
                                        if (!dom.endsWith(".")) dom += ".";