highlightColor now set correctly
This commit is contained in:
+5
-1
@@ -31,6 +31,7 @@ export default class PopupMenu extends Popup {
|
||||
notchSize = 10,
|
||||
maxWidth = 800,
|
||||
backgroundColor = '#EEE',
|
||||
highlightBackgroundColor = '#EEE',
|
||||
normalColor = '#444',
|
||||
highlightColor = 'black',
|
||||
notchPosition = 'bottomLeft',
|
||||
@@ -42,6 +43,7 @@ export default class PopupMenu extends Popup {
|
||||
this.switchPos = switchPos
|
||||
this.spacing = spacing
|
||||
this.highlightColor = highlightColor
|
||||
this.highlightBackgroundColor = highlightBackgroundColor
|
||||
}
|
||||
|
||||
/** Setup menu with a dictionary of command labels and command functions.
|
||||
@@ -101,6 +103,7 @@ export default class PopupMenu extends Popup {
|
||||
update(key, highlight = false) {
|
||||
let text = this.items[key]
|
||||
text.style.color = (highlight) ? this.highlightColor : this.normalColor
|
||||
text.style.background = (highlight) ? this.highlightBackgroundColor : this.backgroundColor
|
||||
}
|
||||
|
||||
/** Mouse over handöer.
|
||||
@@ -158,6 +161,7 @@ export default class PopupMenu extends Popup {
|
||||
maxWidth = 800,
|
||||
keepWithin = null,
|
||||
backgroundColor = '#EEE',
|
||||
highlightBackgroundColor = '#EEE',
|
||||
normalColor = '#444',
|
||||
autoClose = true } = {}) {
|
||||
|
||||
@@ -171,7 +175,7 @@ export default class PopupMenu extends Popup {
|
||||
let popup = new PopupMenu({
|
||||
parent, fontSize, padding, zIndex, spacing, switchPos, notchSize,
|
||||
notchPosition,
|
||||
maxWidth, backgroundColor, normalColor,
|
||||
maxWidth, backgroundColor, normalColor, highlightColor, highlightBackgroundColor,
|
||||
notchPosition, keepWithin, autoClose
|
||||
})
|
||||
popup.showAt(commands, point)
|
||||
|
||||
Reference in New Issue
Block a user