diff options
author | Florrie <towerofnix@gmail.com> | 2018-07-04 22:50:39 -0300 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2018-07-04 22:50:39 -0300 |
commit | eebff4fbbac489f96954f05d6d0d838c62a8e6c7 (patch) | |
tree | d98e02291111578f298460b5c4e250c5959036e6 /ui/form/FocusElement.js | |
parent | 4ddc3ece7d713633347f2702c30806b4a2e18ca4 (diff) |
An assortment of changes to how selected/unselected works
Diffstat (limited to 'ui/form/FocusElement.js')
-rw-r--r-- | ui/form/FocusElement.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ui/form/FocusElement.js b/ui/form/FocusElement.js index 9061838..23c2e02 100644 --- a/ui/form/FocusElement.js +++ b/ui/form/FocusElement.js @@ -11,11 +11,11 @@ module.exports = class FocusElement extends DisplayElement { this.cursorY = 0 } - focused() { + selected() { // Should be overridden in subclasses. } - unfocused() { + unselected() { // Should be overridden in subclasses. } @@ -36,8 +36,8 @@ module.exports = class FocusElement extends DisplayElement { } get isSelected() { - const selected = this.root.selected - return selected && [selected, ...selected.directAncestors].includes(this) + const selected = this.root.selectedElement + return !!(selected && [selected, ...selected.directAncestors].includes(this)) } get absCursorX() { return this.absX + this.cursorX } |