aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2019-06-23 12:53:29 +0200
committerRobert Jaros <rjaros@finn.pl>2019-06-23 12:53:29 +0200
commite342615c0e9b126cce1b0e81129a8d3b5967a2ce (patch)
tree7bc2dbb0f69e2197e533c3f763d6783336be4ed7 /src
parent3553bcf8f6391804312c7ff9c47100999e101c73 (diff)
downloadkvision-e342615c0e9b126cce1b0e81129a8d3b5967a2ce.tar.gz
kvision-e342615c0e9b126cce1b0e81129a8d3b5967a2ce.tar.bz2
kvision-e342615c0e9b126cce1b0e81129a8d3b5967a2ce.zip
Style fix.
Diffstat (limited to 'src')
-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.
*