File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
composeApp/src/wasmJsMain/kotlin/com/krossovochkin/chesskt Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import kotlinx.browser.window
99import kotlin.math.min
1010import org.jetbrains.compose.resources.ExperimentalResourceApi
1111import org.w3c.dom.HTMLElement
12+ import org.w3c.dom.Element
1213
1314@OptIn(ExperimentalComposeUiApi ::class , ExperimentalResourceApi ::class )
1415fun main () {
@@ -24,6 +25,7 @@ fun main() {
2425}
2526
2627private fun getContainerSize (): Int? {
28+ val windowWithFrame = js(" window" ) as WindowWithFrameElement
2729 val iframe = windowWithFrame.frameElement as ? HTMLElement
2830 return if (iframe != null ) {
2931 min(iframe.offsetWidth, iframe.offsetHeight)
@@ -32,9 +34,6 @@ private fun getContainerSize(): Int? {
3234 }.takeIf { it > 0 }
3335}
3436
35- @JsName(" window" )
36- external val windowWithFrame: WindowWithFrameElement
37-
38- external interface WindowWithFrameElement : org.w3c.dom.Window {
39- val frameElement: org.w3c.dom.Element ?
37+ external interface WindowWithFrameElement {
38+ val frameElement: Element ?
4039}
You can’t perform that action at this time.
0 commit comments