Tags can now be added and removed

This commit is contained in:
Greg Burri 2025-01-04 22:43:20 +01:00
parent f8333651fd
commit 9b0fcec5e2
5 changed files with 142 additions and 36 deletions

View file

@ -2,14 +2,14 @@ use gloo::utils::document;
use wasm_bindgen::prelude::*;
use web_sys::Element;
pub trait SelectExt {
fn select<T>(&self, selectors: &str) -> T
pub trait SelectorExt {
fn selector<T>(&self, selectors: &str) -> T
where
T: JsCast;
}
impl SelectExt for Element {
fn select<T>(&self, selectors: &str) -> T
impl SelectorExt for Element {
fn selector<T>(&self, selectors: &str) -> T
where
T: JsCast,
{
@ -21,7 +21,7 @@ impl SelectExt for Element {
}
}
pub fn select<T>(selectors: &str) -> T
pub fn selector<T>(selectors: &str) -> T
where
T: JsCast,
{
@ -33,7 +33,7 @@ where
.unwrap()
}
pub fn select_and_clone<T>(selectors: &str) -> T
pub fn selector_and_clone<T>(selectors: &str) -> T
where
T: JsCast,
{