refactor
This commit is contained in:
parent
ed739d792f
commit
e9a9dad037
19 changed files with 278 additions and 177 deletions
|
@ -17,7 +17,7 @@ pub struct LinkWidget(Box<dyn UIWidget>, String, HashMap<String, String>);
|
|||
|
||||
impl AttrExtendable for LinkWidget {
|
||||
fn add_attr(mut self, key: &str, val: &str) -> Self {
|
||||
self.2.insert(key.to_string(), val.to_string());
|
||||
self.2.insert(key.to_string(), val.replace('\'', "\\'"));
|
||||
self
|
||||
}
|
||||
|
||||
|
@ -67,6 +67,7 @@ impl UIWidget for LinkWidget {
|
|||
|
||||
impl LinkWidget {
|
||||
/// Enable HTMX link capabilities
|
||||
#[must_use]
|
||||
pub fn use_htmx(self) -> Self {
|
||||
let url = self.1.clone();
|
||||
self.hx_get(&url)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue