From 769eb4cb7f44832b9e8ba48c84d900e13f06c851 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Tue, 2 Jun 2020 23:32:40 +0200 Subject: Fix hooks calling order (#156) --- src/main/kotlin/pl/treksoft/kvision/core/Widget.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main') diff --git a/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt b/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt index b28943dd..72c5699c 100644 --- a/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt +++ b/src/main/kotlin/pl/treksoft/kvision/core/Widget.kt @@ -326,10 +326,12 @@ open class Widget(classes: Set = setOf()) : StyledComponent(), Component vnode = v afterInsertInternal(v) afterInsert(v) + afterInsertHook?.invoke(v) } destroy = { afterDestroyInternal() afterDestroy() + afterDestroyHook?.invoke() vnode = null vnode } @@ -806,7 +808,6 @@ open class Widget(classes: Set = setOf()) : StyledComponent(), Component content = it.content?.let { translate(it) }).toJs() ) } - this.afterInsertHook?.invoke(node) } /** @@ -828,7 +829,6 @@ open class Widget(classes: Set = setOf()) : StyledComponent(), Component val popoverFun = getElementJQueryD()?.popover if (popoverFun != undefined) getElementJQueryD()?.popover("dispose") } - this.afterDestroyHook?.invoke() } /** -- cgit