mirror of
https://github.com/dmuth/diceware.git
synced 2024-11-21 16:36:28 -05: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) {
|
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()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue