mirror of
https://github.com/dmuth/diceware.git
synced 2024-12-22 14:53:45 +00:00
Add handlers to address #24.
This commit is contained in:
parent
9eed6a72a7
commit
98c7e131bd
1 changed files with 13 additions and 0 deletions
13
src/index.js
13
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()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue