diff options
Diffstat (limited to 'WebInterface/wasm/webhogg/src/page.rs')
-rw-r--r-- | WebInterface/wasm/webhogg/src/page.rs | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/WebInterface/wasm/webhogg/src/page.rs b/WebInterface/wasm/webhogg/src/page.rs deleted file mode 100644 index cb9ee3f..0000000 --- a/WebInterface/wasm/webhogg/src/page.rs +++ /dev/null @@ -1,26 +0,0 @@ -use web_sys; - -use crate::webhogg_exception::WebhoggException; - -pub struct Page { - window: web_sys::Window, - document: web_sys::Document, -} - -impl Page { - pub fn obtain() -> Result<Self, WebhoggException> { - let window = web_sys::window() - .ok_or(WebhoggException::DomError("could not obtain window".to_string()))?; - let document = window.document() - .ok_or(WebhoggException::DomError("could not obtain document".to_string()))?; - debug!("initialised page"); - Ok(Self { - window, - document, - }) - } - - pub fn get_element(&self, id: &str) -> Option<web_sys::Element> { - self.document.get_element_by_id(id) - } -} |