aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/dropdown/ContextMenu.kt8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/dropdown/ContextMenu.kt b/src/main/kotlin/pl/treksoft/kvision/dropdown/ContextMenu.kt
index c09737f2..5fac0494 100644
--- a/src/main/kotlin/pl/treksoft/kvision/dropdown/ContextMenu.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/dropdown/ContextMenu.kt
@@ -66,8 +66,8 @@ open class ContextMenu(
*/
open fun positionMenu(mouseEvent: MouseEvent): ContextMenu {
if (fixedPosition) {
- this.top = 5.px
- this.left = 5.px
+ this.top = DEFAULT_FIXED_POS_Y.px
+ this.left = DEFAULT_FIXED_POS_X.px
} else {
this.top = mouseEvent.pageY.toInt().px
this.left = mouseEvent.pageX.toInt().px
@@ -77,6 +77,10 @@ open class ContextMenu(
}
companion object {
+
+ const val DEFAULT_FIXED_POS_X = 5
+ const val DEFAULT_FIXED_POS_Y = 5
+
/**
* DSL builder extension function.
*