This repository was archived by the owner on Mar 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
projector-client-web/src/main/kotlin/org/jetbrains/projector/client/web/component Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ kotlinExtensionsVersion=1.0.1-pre.284-kotlin-1.6.10
4242kotlinReactVersion =17.0.2-pre.284-kotlin-1.6.10
4343kotlinStyledComponentsVersion =5.3.3-pre.284-kotlin-1.6.10
4444ktorVersion =1.6.7
45- openVersion =^ 8.4.0
45+ openVersion =8.4.0
4646radiumVersion =0.26.1
4747reactLoadingIndicatorVersion =1.0.2
4848selenideVersion =6.1.2
Original file line number Diff line number Diff line change @@ -25,16 +25,20 @@ package org.jetbrains.projector.client.web.component
2525
2626import kotlinx.browser.document
2727import org.w3c.dom.HTMLIFrameElement
28+ import org.w3c.dom.events.EventListener
2829
2930abstract class ClientComponent (
3031 protected val id : Int ,
3132) {
3233
34+ private val documentListeners = mutableMapOf<String , EventListener >()
35+
3336 val iFrame: HTMLIFrameElement = createIFrame(id)
3437
3538 var windowId: Int? = null
3639
3740 fun dispose () {
41+ documentListeners.forEach { document.removeEventListener(it.key, it.value) }
3842 iFrame.remove()
3943 }
4044
@@ -60,6 +64,15 @@ abstract class ClientComponent(
6064 }
6165
6266 contentDocument!! .oncontextmenu = { false }
67+
68+ documentListeners[" mousedown" ] = EventListener {
69+ style.asDynamic().pointerEvents = " none"
70+ }
71+ documentListeners[" mouseup" ] = EventListener {
72+ style.asDynamic().pointerEvents = " auto"
73+ }
74+
75+ documentListeners.forEach { document.addEventListener(it.key, it.value) }
6376 }
6477
6578 protected fun setLinkProcessor (linkProcessor : (String ) -> Unit ) {
You can’t perform that action at this time.
0 commit comments