small func
This commit is contained in:
@@ -99,6 +99,11 @@ impl ComponentId {
|
|||||||
// URL_SAFE because we cannot have slashes in the output
|
// URL_SAFE because we cannot have slashes in the output
|
||||||
base64::engine::general_purpose::URL_SAFE.encode(id)
|
base64::engine::general_purpose::URL_SAFE.encode(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tracing::instrument]
|
||||||
|
fn selector(&self) -> String {
|
||||||
|
format!("#{}", self.html_id())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for ComponentId {
|
impl fmt::Display for ComponentId {
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ impl<'a> Component for HeaderLink<'a> {
|
|||||||
a
|
a
|
||||||
href=(self.args.item.path())
|
href=(self.args.item.path())
|
||||||
hx-get=(self.args.item.path())
|
hx-get=(self.args.item.path())
|
||||||
hx-target={ "#" (self.htmx.target().html_id()) }
|
hx-target=(self.htmx.target().selector())
|
||||||
hx-swap="outerHtml"
|
hx-swap="outerHtml"
|
||||||
hx-push-url="true"
|
hx-push-url="true"
|
||||||
#{"header-link-" (self.args.item.id())}
|
#{"header-link-" (self.args.item.id())}
|
||||||
@@ -129,7 +129,7 @@ impl<'a> Component for Body<'a> {
|
|||||||
#home
|
#home
|
||||||
href=(self.htmx.fallback_action)
|
href=(self.htmx.fallback_action)
|
||||||
hx-get=(self.htmx.action)
|
hx-get=(self.htmx.action)
|
||||||
hx-target={ "#" (self.htmx.target()) }
|
hx-target=(self.htmx.target().selector())
|
||||||
hx-swap="outerHTML"
|
hx-swap="outerHTML"
|
||||||
."flex"
|
."flex"
|
||||||
."flex-row"
|
."flex-row"
|
||||||
|
|||||||
Reference in New Issue
Block a user