Skip to content

Commit bf2f72e

Browse files
author
Simon Brooke
committed
- Force number of dice to be 2 - 9 if manually typed in
1 parent a3b756c commit bf2f72e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Household/Household.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,5 +1007,25 @@ <h3 data-i18n="notes-u">Notes</h3>
10071007
setAttrs({lastroll: ""});
10081008
});
10091009

1010+
/*
1011+
*
1012+
*/
1013+
on("change:num_dice", function(e) {
1014+
1015+
console.log("change:num_dice: " + JSON.stringify(e));
1016+
1017+
let attrs;
1018+
if(+e.newValue < 2) {
1019+
attrs = {num_dice: 2};
1020+
}
1021+
if(+e.newValue > 9) {
1022+
attrs = {num_dice: 9};
1023+
}
1024+
1025+
if(attrs) {
1026+
setAttrs(attrs);
1027+
}
1028+
});
1029+
10101030
</script>
10111031
</div>

0 commit comments

Comments
 (0)