From 99dcb8e434d7e0ccf5dada379c1b03e894e6aa82 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Wed, 26 Feb 2020 13:30:23 +0100 Subject: Major changes in the event handling architecture. Support for multiple event handlers. --- .../main/kotlin/pl/treksoft/kvision/form/upload/Upload.kt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'kvision-modules/kvision-bootstrap-upload') diff --git a/kvision-modules/kvision-bootstrap-upload/src/main/kotlin/pl/treksoft/kvision/form/upload/Upload.kt b/kvision-modules/kvision-bootstrap-upload/src/main/kotlin/pl/treksoft/kvision/form/upload/Upload.kt index 20d836f0..3ba635fd 100644 --- a/kvision-modules/kvision-bootstrap-upload/src/main/kotlin/pl/treksoft/kvision/form/upload/Upload.kt +++ b/kvision-modules/kvision-bootstrap-upload/src/main/kotlin/pl/treksoft/kvision/form/upload/Upload.kt @@ -228,15 +228,18 @@ open class Upload( } @Suppress("UNCHECKED_CAST") - override fun setEventListener(block: SnOn.() -> Unit): Widget { - input.setEventListener(block) - return this + override fun setEventListener(block: SnOn.() -> Unit): Int { + return input.setEventListener(block) } @Deprecated("Use onEvent extension function instead.", ReplaceWith("onEvent(block)", "pl.treksoft.kvision.core.onEvent")) - override fun setEventListener(block: SnOn.() -> Unit): Widget { + override fun setEventListener(block: SnOn.() -> Unit): Int { @Suppress("DEPRECATION") - input.setEventListener(block) + return input.setEventListener(block) + } + + override fun removeEventListener(id: Int): Widget { + input.removeEventListener(id) return this } -- cgit