aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2019-07-09 22:27:08 +0200
committerRobert Jaros <rjaros@finn.pl>2019-07-09 22:27:08 +0200
commitf6f69f78b2960ae087e4ad55479a27b805a5b46c (patch)
tree9b63e512bbbf829295f073cf73532ede52b74422
parent5dc1fb5b0e4ceff6be378aaf88b71f3b577cae0d (diff)
downloadkvision-f6f69f78b2960ae087e4ad55479a27b805a5b46c.tar.gz
kvision-f6f69f78b2960ae087e4ad55479a27b805a5b46c.tar.bz2
kvision-f6f69f78b2960ae087e4ad55479a27b805a5b46c.zip
Fix tests.
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/window/Window.kt14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/window/Window.kt b/src/main/kotlin/pl/treksoft/kvision/window/Window.kt
index b0a3cb7d..7dfeb921 100644
--- a/src/main/kotlin/pl/treksoft/kvision/window/Window.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/window/Window.kt
@@ -167,7 +167,10 @@ open class Window(
private val maximizeIcon = MaximizeIcon()
private val minimizeIcon = MinimizeIcon()
private val captionTag = Tag(TAG.H4, caption, classes = setOf("modal-title"))
- private val windowIcon = Icon(icon ?: "").apply { addCssClass("window-icon") }
+ private val windowIcon = Icon(icon ?: "").apply {
+ addCssClass("window-icon")
+ visible = (icon != null && icon != "")
+ }
private var isResizeEvent = false
@@ -183,7 +186,8 @@ open class Window(
zIndex = ++zIndexCounter
closeIcon.visible = closeButton
closeIcon.setEventListener {
- click = { e ->
+ click = { _ ->
+ @Suppress("UnsafeCastFromDynamic")
if (this@Window.dispatchEvent("closeWindow", obj {}) != false) {
close()
}
@@ -195,7 +199,8 @@ open class Window(
header.add(closeIcon)
maximizeIcon.visible = maximizeButton
maximizeIcon.setEventListener {
- click = { e ->
+ click = { _ ->
+ @Suppress("UnsafeCastFromDynamic")
if (this@Window.dispatchEvent("maximizeWindow", obj {}) != false) {
toggleMaximize()
}
@@ -207,7 +212,8 @@ open class Window(
header.add(maximizeIcon)
minimizeIcon.visible = minimizeButton
minimizeIcon.setEventListener {
- click = { e ->
+ click = { _ ->
+ @Suppress("UnsafeCastFromDynamic")
if (this@Window.dispatchEvent("minimizeWindow", obj {}) != false) {
toggleMinimize()
}