mirror of
https://github.com/Nighthawk42/roll20-character-sheets.git
synced 2026-08-30 03:40:32 +00:00
- Force number of dice to be 2 - 9 if manually typed in
This commit is contained in:
@@ -1007,5 +1007,25 @@
|
||||
setAttrs({lastroll: ""});
|
||||
});
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
on("change:num_dice", function(e) {
|
||||
|
||||
console.log("change:num_dice: " + JSON.stringify(e));
|
||||
|
||||
let attrs;
|
||||
if(+e.newValue < 2) {
|
||||
attrs = {num_dice: 2};
|
||||
}
|
||||
if(+e.newValue > 9) {
|
||||
attrs = {num_dice: 9};
|
||||
}
|
||||
|
||||
if(attrs) {
|
||||
setAttrs(attrs);
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
</div>
|
||||
Reference in New Issue
Block a user