Skip to content

Commit

Permalink
give tooltips unique id #120
Browse files Browse the repository at this point in the history
  • Loading branch information
Zukkari committed Feb 8, 2018
1 parent e2e8ec5 commit b519383
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/main/kotlin/cs/ut/ui/adapters/AdvancedModeAdapter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class AdvancedModeAdapter : GridValueProvider<GeneratorArgument, Row> {
this.align = "center"
this.appendChild(label)
})
row.appendChild(getTooltipButton(data.id))
row.appendChild(getTooltip(data.id))

data.params.forEach { param ->
row.appendChild(Hlayout().also {
Expand All @@ -46,12 +46,12 @@ class AdvancedModeAdapter : GridValueProvider<GeneratorArgument, Row> {
})
})
})
row.appendChild(getTooltipButton(param.id))
row.appendChild(getTooltip(param.id))
}
return row
}

private fun getTooltipButton(tooltip: String): A {
private fun getTooltip(tooltip: String): A {
return A().apply {
this.vflex = "1"
this.hflex = "min"
Expand All @@ -62,7 +62,13 @@ class AdvancedModeAdapter : GridValueProvider<GeneratorArgument, Row> {
parser.readTooltip(tooltip).also {
this.appendChild(it)
it.sclass = "n-popup"
it.id = ValidationViewAdapter.PROP_POPUP
it.id = tooltip

it.addEventListener(Events.ON_CLICK, { _ ->
it.close()
it.detach()
})


it.addEventListener(Events.ON_OPEN, { e ->
e as OpenEvent
Expand Down

0 comments on commit b519383

Please sign in to comment.