From 9d477f12594e88766cdc8c7b46eab8f78f01c0f6 Mon Sep 17 00:00:00 2001 From: bordun Date: Thu, 14 May 2020 01:37:05 +0200 Subject: [PATCH] inspector: fold all categories by default --- src/client/ui/ui-inspector.js | 14 +++++++------- src/scss/ui/inspector.scss | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/client/ui/ui-inspector.js b/src/client/ui/ui-inspector.js index 777fedbc..3057f78e 100644 --- a/src/client/ui/ui-inspector.js +++ b/src/client/ui/ui-inspector.js @@ -18,7 +18,7 @@ class UiInspector extends UiWidget { this.mounted = false - this.foldedCategories = [] + this.expandedCategories = ['widget'] this.widget = null @@ -26,12 +26,12 @@ class UiInspector extends UiWidget { if (e.target.classList.contains('category-header')) { var name = e.target.getAttribute('data-name'), - foldedIndex = this.foldedCategories.indexOf(name) - e.target.parentNode.classList.toggle('folded', foldedIndex < 0) - if (foldedIndex > -1) { - this.foldedCategories.splice(foldedIndex, 1) + expandedIndex = this.expandedCategories.indexOf(name) + e.target.parentNode.classList.toggle('expanded', expandedIndex < 0) + if (expandedIndex > -1) { + this.expandedCategories.splice(expandedIndex, 1) } else { - this.foldedCategories.push(name) + this.expandedCategories.push(name) } } @@ -135,7 +135,7 @@ class UiInspector extends UiWidget { if (category) content.appendChild(category) - category = html`` + category = html`` field = html`
${props[propName]}${propName === '_widget' && widgets.length > 1 ? `s (${widgets.length})` : ''}
` diff --git a/src/scss/ui/inspector.scss b/src/scss/ui/inspector.scss index a75a6e7a..81d353e0 100644 --- a/src/scss/ui/inspector.scss +++ b/src/scss/ui/inspector.scss @@ -115,7 +115,7 @@ osc-inspector-category { } - &.folded { + &:not(.expanded) { --alpha-fill: 0.10; margin-bottom: 0;