diff --git a/src/app.rs b/src/app.rs index 165ed87..573b433 100644 --- a/src/app.rs +++ b/src/app.rs @@ -33,7 +33,7 @@ impl Component for App { type Properties = (); fn create(ctx: &Context) -> Self { - let mut game = Game::new(50, 40, 200); + let mut game = Game::new(10, 10, 10); game.start_board(); // info!("\n{}", game.get_board().to_string()); diff --git a/src/components/button.rs b/src/components/button.rs index d98ae05..67ac000 100644 --- a/src/components/button.rs +++ b/src/components/button.rs @@ -44,7 +44,7 @@ impl Component for Button { class={if self.cell.is_hidden() {"button-hidden"} else {"button-shown"}} onclick={self.link.callback(|_| Msg::Clicked)} // oncontextmenu={self.link.callback(|_| Msg::Clicked)} - oncontextmenu={self.link.callback(|_| Msg::RightClicked)} + oncontextmenu={self.link.callback(|e: MouseEvent| {drop(e); Msg::RightClicked})} // style={(if !self.cell.is_hidden() {format!("background-color: #2f2f2f; transition: background-color 0.5s; transition-delay: {}s;", self.cell.get_delay())} else {"".to_string()}).as_str()} style={style}> { &self.cell.to_string() } @@ -59,6 +59,9 @@ impl Component for Button { // info!("hid (from cell): {}", format!("{:?}", self.cell.is_hidden())); self.onsignal.emit(self.cell); } + Msg::RightClicked => { + self.onsignal.emit(self.cell); + }, } false }