aboutsummaryrefslogtreecommitdiff
path: root/src/js/index.js
diff options
context:
space:
mode:
authorIan Coleman <coleman.ian@gmail.com>2016-12-12 10:51:37 +1100
committerIan Coleman <coleman.ian@gmail.com>2016-12-12 10:51:37 +1100
commit32fab2c39507357909438c2be8cd100c6539038f (patch)
treea2ecb8d2de7dbf0ae48ce20c1cab5bce8d0e287b /src/js/index.js
parent5eaa6877bca7f220bc2364be96c8fcb7526dedbb (diff)
downloadBIP39-32fab2c39507357909438c2be8cd100c6539038f.tar.gz
BIP39-32fab2c39507357909438c2be8cd100c6539038f.tar.zst
BIP39-32fab2c39507357909438c2be8cd100c6539038f.zip
bip44TabSelected and bip32TabSelected functions
This is more descriptive than a blob of jquery, and simplifies reuse in the near future.
Diffstat (limited to 'src/js/index.js')
-rw-r--r--src/js/index.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/js/index.js b/src/js/index.js
index 1e66dd8..6367c01 100644
--- a/src/js/index.js
+++ b/src/js/index.js
@@ -388,7 +388,7 @@
388 } 388 }
389 389
390 function getDerivationPath() { 390 function getDerivationPath() {
391 if (DOM.bip44tab.hasClass("active")) { 391 if (bip44TabSelected()) {
392 var purpose = parseIntNoNaN(DOM.bip44purpose.val(), 44); 392 var purpose = parseIntNoNaN(DOM.bip44purpose.val(), 44);
393 var coin = parseIntNoNaN(DOM.bip44coin.val(), 0); 393 var coin = parseIntNoNaN(DOM.bip44coin.val(), 0);
394 var account = parseIntNoNaN(DOM.bip44account.val(), 0); 394 var account = parseIntNoNaN(DOM.bip44account.val(), 0);
@@ -403,7 +403,7 @@
403 console.log("Using derivation path from BIP44 tab: " + derivationPath); 403 console.log("Using derivation path from BIP44 tab: " + derivationPath);
404 return derivationPath; 404 return derivationPath;
405 } 405 }
406 else if (DOM.bip32tab.hasClass("active")) { 406 else if (bip32TabSelected()) {
407 var derivationPath = DOM.bip32path.val(); 407 var derivationPath = DOM.bip32path.val();
408 console.log("Using derivation path from BIP32 tab: " + derivationPath); 408 console.log("Using derivation path from BIP32 tab: " + derivationPath);
409 return derivationPath; 409 return derivationPath;
@@ -940,6 +940,14 @@
940 DOM.qrHint.toggleClass("hidden"); 940 DOM.qrHint.toggleClass("hidden");
941 } 941 }
942 942
943 function bip44TabSelected() {
944 return DOM.bip44tab.hasClass("active");
945 }
946
947 function bip32TabSelected() {
948 return DOM.bip32tab.hasClass("active");
949 }
950
943 var networks = [ 951 var networks = [
944 { 952 {
945 name: "Bitcoin", 953 name: "Bitcoin",