From 863398c2e18f0cadedd07296bad55df508919eb3 Mon Sep 17 00:00:00 2001 From: bordun Date: Sun, 17 Jan 2021 18:38:39 +0100 Subject: [PATCH] modal: fix visible property (add Widget.childrenVisible() handle this kind of exceptions properly) --- CHANGELOG.md | 4 +++- src/client/ui/ui-colorpicker.js | 7 +++++++ src/client/widgets/common/widget.js | 8 +++++++- src/client/widgets/containers/modal.js | 4 ++-- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 46b36750..bd798fa4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,12 @@ # Changelog -## next +## 1.8.3 - bug fixes - keyboard: allow note numbers up to 127 - server: return http 404 error when a user-requested resource is not found instead of keeping a pending request + - modal: `vibible` property not applied correctly + - project tree - add an input for filtering displayed widget by id diff --git a/src/client/ui/ui-colorpicker.js b/src/client/ui/ui-colorpicker.js index 8d962438..5871f016 100644 --- a/src/client/ui/ui-colorpicker.js +++ b/src/client/ui/ui-colorpicker.js @@ -100,6 +100,13 @@ class ColorPicker extends UiWidget { } + childrenVisible() { + + return true + + } + + setName(n = '') { this.name = n diff --git a/src/client/widgets/common/widget.js b/src/client/widgets/common/widget.js index e146b1f1..e71e3a29 100644 --- a/src/client/widgets/common/widget.js +++ b/src/client/widgets/common/widget.js @@ -1065,7 +1065,13 @@ class Widget extends EventEmitter { isVisible() { - return this.getProp('visible') && this.parent.isVisible() + return this.getProp('visible') && this.parent.childrenVisible() + + } + + childrenVisible() { + + return this.isVisible() } diff --git a/src/client/widgets/containers/modal.js b/src/client/widgets/containers/modal.js index 54ce553a..1010654c 100644 --- a/src/client/widgets/containers/modal.js +++ b/src/client/widgets/containers/modal.js @@ -127,9 +127,9 @@ class Modal extends Panel { } - isVisible() { + childrenVisible() { - return this.init && this.value && super.isVisible() + return this.init && this.value && this.isVisible() }