feat: Updating id key for usage in views, for typesafe keys
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
import Elementary
|
||||
|
||||
extension HTMLAttribute where Tag: HTMLTrait.Attributes.Global {
|
||||
|
||||
static var customToggleFloatAfterRequest: Self {
|
||||
.custom(
|
||||
name: "hx-on::after-request",
|
||||
value: "if(event.detail.successful) toggleContent('float')"
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import Elementary
|
||||
import SharedModels
|
||||
|
||||
struct Float<C: HTML, B: HTML>: HTML {
|
||||
|
||||
@@ -61,14 +62,17 @@ extension Float where B == DefaultCloseButton {
|
||||
init(
|
||||
id: String = "float",
|
||||
shouldDisplay: Bool,
|
||||
resetURL: String? = nil,
|
||||
resetURL route: ViewRoute? = nil,
|
||||
@HTMLBuilder body: () -> C
|
||||
) {
|
||||
self.init(
|
||||
id: id,
|
||||
shouldDisplay: shouldDisplay,
|
||||
body: body,
|
||||
closeButton: { DefaultCloseButton(id: id, resetURL: resetURL) }
|
||||
closeButton: { DefaultCloseButton(
|
||||
id: id,
|
||||
resetURL: route != nil ? ViewRoute.router.path(for: route!) : nil
|
||||
) }
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user