aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/window
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2018-05-22 14:35:45 +0200
committerRobert Jaros <rjaros@finn.pl>2018-05-22 14:35:45 +0200
commitf63340e6324b557abb96cacc6df3d94f5b1fa71d (patch)
tree22777247e79917928bb094768fd9c571de81bc51 /src/main/kotlin/pl/treksoft/kvision/window
parent1cb5675924a56baf6f8dce62e569bf6f2416d58e (diff)
downloadkvision-f63340e6324b557abb96cacc6df3d94f5b1fa71d.tar.gz
kvision-f63340e6324b557abb96cacc6df3d94f5b1fa71d.tar.bz2
kvision-f63340e6324b557abb96cacc6df3d94f5b1fa71d.zip
Add resizeWindow event to Window component.
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/window')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/window/Window.kt8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/window/Window.kt b/src/main/kotlin/pl/treksoft/kvision/window/Window.kt
index 2b1aabb7..bdfb2c0f 100644
--- a/src/main/kotlin/pl/treksoft/kvision/window/Window.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/window/Window.kt
@@ -36,6 +36,7 @@ import pl.treksoft.kvision.html.TAG
import pl.treksoft.kvision.html.Tag
import pl.treksoft.kvision.modal.CloseIcon
import pl.treksoft.kvision.panel.SimplePanel
+import pl.treksoft.kvision.utils.obj
import pl.treksoft.kvision.utils.px
internal const val DEFAULT_Z_INDEX = 900
@@ -230,6 +231,7 @@ open class Window(
}
}
+ @Suppress("UnsafeCastFromDynamic")
private fun checkResizablEventHandler() {
if (isResizable) {
isResizeEvent = true
@@ -244,6 +246,12 @@ open class Window(
isResizable = true
content.width = (intWidth - 2).px
content.height = (intHeight - WINDOW_HEADER_HEIGHT - WINDOW_CONTENT_MARGIN_BOTTOM - 1 - 2).px
+ this.dispatchEvent("resizeWindow", obj {
+ detail = obj {
+ this.width = intWidth
+ this.height = intHeight
+ }
+ })
}
}
} else if (isResizeEvent) {