Implement stdweb backend for web platform

This commit is contained in:
Héctor Ramón Jiménez 2019-06-27 00:02:46 +02:00
parent 1596cc5d9e
commit bb285984da
10 changed files with 355 additions and 906 deletions

View file

@ -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()
}
}