Shopping list (WIP)

This commit is contained in:
Greg Burri 2025-02-11 19:39:13 +01:00
parent ce3821b94e
commit 084be9fb00
16 changed files with 296 additions and 90 deletions

View file

@ -13,6 +13,8 @@ pub trait SelectorExt {
fn selector_all<T>(&self, selectors: &str) -> Vec<T>
where
T: JsCast;
fn deep_clone(&self) -> Self;
}
impl SelectorExt for Element {
@ -38,6 +40,13 @@ impl SelectorExt for Element {
.map(|e| e.unwrap().dyn_into::<T>().unwrap())
.collect()
}
fn deep_clone(&self) -> Self {
self.clone_node_with_deep(true)
.unwrap()
.dyn_into::<Element>()
.unwrap()
}
}
pub fn selector<T>(selectors: &str) -> T