aboutsummaryrefslogtreecommitdiff
path: root/bip39-standalone.html
diff options
context:
space:
mode:
authorIan Coleman <coleman.ian@gmail.com>2014-09-25 10:32:50 +1000
committerIan Coleman <coleman.ian@gmail.com>2014-09-25 10:32:50 +1000
commit04f789cdbdb8e50511efdf97c900f7f83662eedb (patch)
tree86e485edc43a2dfca8a4d1db2ef77b6927fa2fde /bip39-standalone.html
parentd198865f7552237188659c778c0456988c6619df (diff)
downloadBIP39-04f789cdbdb8e50511efdf97c900f7f83662eedb.tar.gz
BIP39-04f789cdbdb8e50511efdf97c900f7f83662eedb.tar.zst
BIP39-04f789cdbdb8e50511efdf97c900f7f83662eedb.zip
Update only happens when phrase is changed
ie not on keyup where the key is ctrl or arrow-key etc.
Diffstat (limited to 'bip39-standalone.html')
-rw-r--r--bip39-standalone.html18
1 files changed, 17 insertions, 1 deletions
diff --git a/bip39-standalone.html b/bip39-standalone.html
index 591cdce..9bc6e88 100644
--- a/bip39-standalone.html
+++ b/bip39-standalone.html
@@ -22733,6 +22733,8 @@ WORDLISTS = {
22733 DOM.privateKeyToggle = $(".private-key-toggle"); 22733 DOM.privateKeyToggle = $(".private-key-toggle");
22734 22734
22735 var derivationPath = DOM.bip44path.val(); 22735 var derivationPath = DOM.bip44path.val();
22736 var currentPhrase = DOM.phrase.val();
22737 var currentPassphrase = DOM.passphrase.val();
22736 22738
22737 function init() { 22739 function init() {
22738 // Events 22740 // Events
@@ -22757,6 +22759,9 @@ WORDLISTS = {
22757 // Event handlers 22759 // Event handlers
22758 22760
22759 function delayedPhraseChanged() { 22761 function delayedPhraseChanged() {
22762 if (!hasChanged()) {
22763 return;
22764 }
22760 hideValidationError(); 22765 hideValidationError();
22761 showPending(); 22766 showPending();
22762 if (phraseChangeTimeoutEvent != null) { 22767 if (phraseChangeTimeoutEvent != null) {
@@ -22786,6 +22791,9 @@ WORDLISTS = {
22786 calcBip32Seed(phrase, passphrase, derivationPath); 22791 calcBip32Seed(phrase, passphrase, derivationPath);
22787 displayBip32Info(); 22792 displayBip32Info();
22788 hidePending(); 22793 hidePending();
22794 // Set current state so we only update as needed
22795 currentPhrase = phrase;
22796 currentPassphrase = passphrase;
22789 } 22797 }
22790 22798
22791 function generateClicked() { 22799 function generateClicked() {
@@ -22807,7 +22815,9 @@ WORDLISTS = {
22807 } 22815 }
22808 22816
22809 function derivationChanged() { 22817 function derivationChanged() {
22810 delayedPhraseChanged(); 22818 hideValidationError();
22819 showPending();
22820 setTimeout(phraseChanged, 50);
22811 } 22821 }
22812 22822
22813 function bip32Changed() { 22823 function bip32Changed() {
@@ -23036,6 +23046,12 @@ WORDLISTS = {
23036 .hide(); 23046 .hide();
23037 } 23047 }
23038 23048
23049 function hasChanged() {
23050 var phraseChanged = DOM.phrase.val() != currentPhrase;
23051 var passphraseChanged = DOM.passphrase.val() != currentPassphrase;
23052 return phraseChanged || passphraseChanged;
23053 }
23054
23039 init(); 23055 init();
23040 23056
23041})(); 23057})();