From 98c7e131bd43bd34f175a0995b8f9c6fcc309e62 Mon Sep 17 00:00:00 2001 From: Douglas Muth Date: Sat, 15 May 2021 15:37:19 -0400 Subject: [PATCH] Add handlers to address #24. --- src/index.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/index.js b/src/index.js index 97a15f3..3b463e6 100644 --- a/src/index.js +++ b/src/index.js @@ -212,6 +212,11 @@ Diceware.rollDiceHandlerPre = function() { */ Diceware.rollDiceHandler = function(e) { + // + // Disable our button while generating results + // + jQuery("#roll_dice").prop("disabled", true); + Diceware.rollDiceHandlerPre(); // @@ -335,13 +340,21 @@ Diceware.rollDiceHandlerPost = function(rolls, passphrase, num_passwords) { // var height = jQuery(".results").height(); jQuery(".results").css("height", "auto"); + var new_height = jQuery(".results").height(); jQuery(".results").height(height); jQuery(".results").animate({height: new_height}, 400); + + // + // All done with our results, re-enable the button! + // + jQuery("#roll_dice").prop("disabled", false); + }); }); + } // End of rollDiceHandlerPost()