Tags can now be added and removed
This commit is contained in:
parent
f8333651fd
commit
9b0fcec5e2
5 changed files with 142 additions and 36 deletions
|
|
@ -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,
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue