maia-wasm 0.2.0

Maia SDR WASM frontend
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use web_sys::Document;

pub trait IsElementActive {
    fn is_element_active(&self, id: &str) -> bool;
}

impl IsElementActive for Document {
    fn is_element_active(&self, id: &str) -> bool {
        self.active_element()
            .map(|elem| elem.id() == id)
            .unwrap_or(false)
    }
}