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