]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/blobdiff - src/js/index.js
BIP44 tab is always visible, unused code removed
[perso/Immae/Projets/Cryptomonnaies/BIP39.git] / src / js / index.js
index 09bcdd9505d7d979086d8c87a2e381df58fe66f8..bad4cfb12a11e53487aa1f99fcf8e3f65c2cdd83 100644 (file)
@@ -16,6 +16,7 @@
     DOM.network = $(".network");
     DOM.phraseNetwork = $("#network-phrase");
     DOM.bip44Network = $("#network-bip44");
+    DOM.addressNetwork = $("#network-address-type");
     DOM.phrase = $(".phrase");
     DOM.passphrase = $(".passphrase");
     DOM.generate = $(".generate");
         if (n == "bitcoin") {
             network = Bitcoin.networks.bitcoin;
             DOM.bip44coin.val(0);
-            setBip44DerivationPath();
-            enableBip44Tab();
         }
         else if (n == "bitcoin-testnet") {
             network = Bitcoin.networks.testnet;
             DOM.bip44coin.val(1);
-            setBip44DerivationPath();
-            enableBip44Tab();
         }
         else if (n == "litecoin") {
             network = Bitcoin.networks.litecoin;
             DOM.bip44coin.val(2);
-            setBip44DerivationPath();
-            enableBip44Tab();
         }
         else if (n == "dogecoin") {
             network = Bitcoin.networks.dogecoin;
-            disableBip44Tab();
+            var NO_BIP44_VALUE = 9999;
+            DOM.bip44coin.val(NO_BIP44_VALUE); // This coin is not in BIP44
         }
+        setBip44DerivationPath();
         DOM.phraseNetwork.val(n);
         DOM.bip44Network.val(n);
+        if(e.target != DOM.addressNetwork.dom){
+            DOM.addressNetwork.val(n);
+        }
         delayedPhraseChanged();
     }
 
             .hide();
     }
 
-    function enableBip44Tab() {
-        // show bip44 tab (but don't select it)
-        DOM.bip44tab.removeClass("hidden");
-        DOM.bip44panel.removeClass("hidden");
-    }
-
-    function disableBip44Tab() {
-        // hide bip44 tab
-        DOM.bip44tab.addClass("hidden");
-        DOM.bip44tab.removeClass("active");
-        // hide bip44 panel
-        DOM.bip44panel.addClass("hidden");
-        DOM.bip44panel.removeClass("active");
-        // show bip32 tab
-        DOM.bip32tab.addClass("active");
-        // show bip32 panel
-        DOM.bip32panel.addClass("active");
-        // set the derivation path
-        var activePath = $("#bip32 .path");
-        derivationPath = activePath.val();
-    }
-
     init();
 
 })();