File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
composeApp/src/wasmJsMain/kotlin/com/krossovochkin/chesskt Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ 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
1312
1413@OptIn(ExperimentalComposeUiApi ::class , ExperimentalResourceApi ::class )
1514fun main () {
@@ -25,15 +24,13 @@ fun main() {
2524}
2625
2726private fun getContainerSize (): Int? {
28- val windowWithFrame = js(" window" ) as WindowWithFrameElement
29- val iframe = windowWithFrame.frameElement as ? HTMLElement
27+ val iframe = rawWindow.frameElement as ? HTMLElement
3028 return if (iframe != null ) {
3129 min(iframe.offsetWidth, iframe.offsetHeight)
3230 } else {
3331 min(window.innerWidth, window.innerHeight)
3432 }.takeIf { it > 0 }
3533}
3634
37- external interface WindowWithFrameElement {
38- val frameElement: Element ?
39- }
35+ @JsName(" window" )
36+ external val rawWindow: dynamic
You can’t perform that action at this time.
0 commit comments