Add handlers to address #24.

This commit is contained in:
Douglas Muth 2021-05-15 15:37:19 -04:00
parent 9eed6a72a7
commit 98c7e131bd

View file

@ -212,6 +212,11 @@ Diceware.rollDiceHandlerPre = function() {
*/ */
Diceware.rollDiceHandler = function(e) { Diceware.rollDiceHandler = function(e) {
//
// Disable our button while generating results
//
jQuery("#roll_dice").prop("disabled", true);
Diceware.rollDiceHandlerPre(); Diceware.rollDiceHandlerPre();
// //
@ -335,13 +340,21 @@ Diceware.rollDiceHandlerPost = function(rolls, passphrase, num_passwords) {
// //
var height = jQuery(".results").height(); var height = jQuery(".results").height();
jQuery(".results").css("height", "auto"); jQuery(".results").css("height", "auto");
var new_height = jQuery(".results").height(); var new_height = jQuery(".results").height();
jQuery(".results").height(height); jQuery(".results").height(height);
jQuery(".results").animate({height: new_height}, 400); 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() } // End of rollDiceHandlerPost()