aboutsummaryrefslogtreecommitdiff
path: root/src/js/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/index.js')
-rw-r--r--src/js/index.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/js/index.js b/src/js/index.js
index bfaf879..40d15f4 100644
--- a/src/js/index.js
+++ b/src/js/index.js
@@ -23,6 +23,7 @@
23 var generationProcesses = []; 23 var generationProcesses = [];
24 24
25 var DOM = {}; 25 var DOM = {};
26 DOM.privacyScreenToggle = $(".privacy-screen-toggle");
26 DOM.network = $(".network"); 27 DOM.network = $(".network");
27 DOM.bip32Client = $("#bip32-client"); 28 DOM.bip32Client = $("#bip32-client");
28 DOM.phraseNetwork = $("#network-phrase"); 29 DOM.phraseNetwork = $("#network-phrase");
@@ -118,6 +119,7 @@
118 119
119 function init() { 120 function init() {
120 // Events 121 // Events
122 DOM.privacyScreenToggle.on("change", privacyScreenToggled);
121 DOM.generatedStrength.on("change", generatedStrengthChanged); 123 DOM.generatedStrength.on("change", generatedStrengthChanged);
122 DOM.network.on("change", networkChanged); 124 DOM.network.on("change", networkChanged);
123 DOM.bip32Client.on("change", bip32ClientChanged); 125 DOM.bip32Client.on("change", bip32ClientChanged);
@@ -447,6 +449,17 @@
447 $("td.privkey span").toggleClass("invisible"); 449 $("td.privkey span").toggleClass("invisible");
448 } 450 }
449 451
452 function privacyScreenToggled() {
453 // private-data contains elements added to DOM at runtime
454 // so catch all by adding visual privacy class to the root of the DOM
455 if (DOM.privacyScreenToggle.prop("checked")) {
456 $("body").addClass("visual-privacy");
457 }
458 else {
459 $("body").removeClass("visual-privacy");
460 }
461 }
462
450 // Private methods 463 // Private methods
451 464
452 function generateRandomPhrase() { 465 function generateRandomPhrase() {