File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -130,6 +130,7 @@ class Manager {
130130 // Controls
131131 document . getElementById ( "bake" ) . addEventListener ( "click" , this . controls . bakeClick . bind ( this . controls ) ) ;
132132 document . getElementById ( "auto-bake" ) . addEventListener ( "change" , this . controls . autoBakeChange . bind ( this . controls ) ) ;
133+ document . getElementById ( "auto-bake" ) . addEventListener ( "keydown" , this . controls . autoBakeKeyboardHandler . bind ( this . controls ) ) ;
133134 document . getElementById ( "step" ) . addEventListener ( "click" , this . controls . stepClick . bind ( this . controls ) ) ;
134135 document . getElementById ( "clr-recipe" ) . addEventListener ( "click" , this . controls . clearRecipeClick . bind ( this . controls ) ) ;
135136 document . getElementById ( "save" ) . addEventListener ( "click" , this . controls . saveClick . bind ( this . controls ) ) ;
Original file line number Diff line number Diff line change @@ -57,6 +57,18 @@ class ControlsWaiter {
5757 }
5858 }
5959
60+ /**
61+ * Checks or unchecks the Auto Bake checkbox with "Enter"
62+ * @param {Event } ev
63+ */
64+ autoBakeKeyboardHandler ( ev ) {
65+ const checkBox = document . getElementById ( "auto-bake" ) ;
66+ ev . preventDefault ( ) ;
67+ if ( ev . key === "Enter" || ev . key === " " ) {
68+ checkBox . checked = ! checkBox . checked ;
69+ }
70+ }
71+
6072
6173 /**
6274 * Handler to trigger baking.
You can’t perform that action at this time.
0 commit comments