Implement stdweb backend for web platform
This commit is contained in:
parent
1596cc5d9e
commit
bb285984da
10 changed files with 355 additions and 906 deletions
|
|
@ -1,6 +1,21 @@
|
|||
#[cfg(feature = "stdweb")]
|
||||
impl WindowExtStdweb for RootWindow {
|
||||
mod canvas;
|
||||
mod event;
|
||||
mod timeout;
|
||||
|
||||
pub use self::canvas::Canvas;
|
||||
pub use self::timeout::Timeout;
|
||||
|
||||
use crate::platform::web::WindowExtStdweb;
|
||||
use crate::window::Window;
|
||||
|
||||
use stdweb::web::html_element::CanvasElement;
|
||||
|
||||
pub fn throw(msg: &str) {
|
||||
js! { throw @{msg} }
|
||||
}
|
||||
|
||||
impl WindowExtStdweb for Window {
|
||||
fn canvas(&self) -> CanvasElement {
|
||||
self.window.canvas.clone()
|
||||
self.window.canvas().raw().clone()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue