mirror of
https://github.com/InsanusMokrassar/JSUIKitKBindings.git
synced 2024-11-23 10:38:45 +00:00
add opportunity to now show dialog automatically
This commit is contained in:
parent
5dff8d69f2
commit
432a5744b3
@ -2,6 +2,8 @@
|
||||
|
||||
## 0.4.3
|
||||
|
||||
* Add opportunity to now show dialog automatically
|
||||
|
||||
## 0.4.2
|
||||
|
||||
* `Compose`: `1.2.2`
|
||||
|
@ -36,6 +36,7 @@ fun Dialog(
|
||||
footerAttrsBuilder: AttrBuilderContext<HTMLDivElement>? = null,
|
||||
footerBuilder: ContentBuilder<HTMLDivElement>? = null,
|
||||
bodyAttrsBuilder: AttrBuilderContext<HTMLDivElement>? = null,
|
||||
autoShow: Boolean = true,
|
||||
bodyBuilder: ContentBuilder<HTMLDivElement>
|
||||
) {
|
||||
Div(
|
||||
@ -99,10 +100,12 @@ fun Dialog(
|
||||
}
|
||||
htmlElement.addEventListener("hidden", wrapper)
|
||||
|
||||
if (autoShow) {
|
||||
UIKit.modal("#${htmlElement.id}") ?.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun Dialog(
|
||||
@ -112,6 +115,7 @@ fun Dialog(
|
||||
hidden: (() -> Unit)? = null,
|
||||
footerBuilder: (@Composable () -> Unit)? = null,
|
||||
attributesCustomizer: AttrBuilderContext<HTMLDivElement> = {},
|
||||
autoShow: Boolean = true,
|
||||
bodyBuilder: @Composable () -> Unit
|
||||
) = Dialog(
|
||||
modifiers = modifiers,
|
||||
@ -130,6 +134,7 @@ fun Dialog(
|
||||
attributesCustomizer = {
|
||||
attributesCustomizer()
|
||||
},
|
||||
autoShow = autoShow,
|
||||
bodyBuilder = {
|
||||
bodyBuilder()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user