From eebff4fbbac489f96954f05d6d0d838c62a8e6c7 Mon Sep 17 00:00:00 2001 From: Florrie Date: Wed, 4 Jul 2018 22:50:39 -0300 Subject: An assortment of changes to how selected/unselected works --- ui/form/FocusElement.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ui/form/FocusElement.js') 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 } -- cgit 1.3.0-6-gf8a5