Skip to content

Commit

Permalink
Update developer-tools-template.ts: add independent scrollbars for le…
Browse files Browse the repository at this point in the history
…ft & right panels for large screens (home-assistant#17765)

* Update developer-tools-template.ts

* Update developer-tools-template.ts

* fix overflow

* Update src/panels/developer-tools/template/developer-tools-template.ts

Co-authored-by: Wendelin <12148533+wendevlin@users.noreply.github.com>

* Update src/panels/developer-tools/template/developer-tools-template.ts

Co-authored-by: Wendelin <12148533+wendevlin@users.noreply.github.com>

* Update developer-tools-template.ts

* Update src/panels/developer-tools/template/developer-tools-template.ts

Co-authored-by: Wendelin <12148533+wendevlin@users.noreply.github.com>

* Update developer-tools-template.ts

* prettier

* Update developer-tools-template.ts

* Update developer-tools-template.ts

* prettier

* Update developer-tools-template.ts

* prettier

* prettier

* Update developer-tools-template.ts

* prettier

* prettier

* prettier

* Update developer-tools-template.ts

---------

Co-authored-by: Wendelin <12148533+wendevlin@users.noreply.github.com>
  • Loading branch information
2 people authored and boern99 committed Dec 11, 2024
1 parent eeddeee commit 150da9c
Showing 1 changed file with 39 additions and 16 deletions.
55 changes: 39 additions & 16 deletions src/panels/developer-tools/template/developer-tools-template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,17 +181,21 @@ class HaPanelDevTemplate extends LitElement {
>`
: nothing}
${this._templateResult
? html`${this.hass.localize(
"ui.panel.developer-tools.tabs.templates.result_type"
)}:
${resultType}
<!-- prettier-ignore -->
<pre class="rendered ${classMap({
[resultType]: resultType,
})}"
>${type === "object"
? JSON.stringify(this._templateResult.result, null, 2)
: this._templateResult.result}</pre>
? html`<pre
class="rendered ${classMap({
[resultType]: resultType,
})}"
>
${type === "object"
? JSON.stringify(this._templateResult.result, null, 2)
: this._templateResult.result}</pre
>
<p>
${this.hass.localize(
"ui.panel.developer-tools.tabs.templates.result_type"
)}:
${resultType}
</p>
${this._templateResult.listeners.time
? html`
<p>
Expand Down Expand Up @@ -249,11 +253,11 @@ class HaPanelDevTemplate extends LitElement {
</ul>
`
: !this._templateResult.listeners.time
? html`<span class="all_listeners">
? html`<p class="all_listeners">
${this.hass.localize(
"ui.panel.developer-tools.tabs.templates.no_listeners"
)}
</span>`
</p>`
: nothing}`
: nothing}
</div>
Expand Down Expand Up @@ -281,6 +285,10 @@ class HaPanelDevTemplate extends LitElement {
max(16px, env(safe-area-inset-left));
}
.content.horizontal {
--code-mirror-max-height: calc(100vh - 389px);
}
ha-card {
margin-bottom: 16px;
}
Expand All @@ -293,8 +301,9 @@ class HaPanelDevTemplate extends LitElement {
color: var(--primary-color);
}
.horizontal .edit-pane {
max-width: 50%;
.content.horizontal > * {
width: 50%;
margin-bottom: 0px;
}
.render-spinner {
Expand All @@ -316,15 +325,29 @@ class HaPanelDevTemplate extends LitElement {
white-space: pre-wrap;
background-color: var(--secondary-background-color);
padding: 8px;
margin-top: 0;
margin-bottom: 0;
direction: ltr;
overflow: auto;
}
p,
ul {
margin-block-end: 0;
}
.content.horizontal .render-pane .card-content {
display: flex;
flex-direction: column;
max-height: calc(var(--code-mirror-max-height) + 47px);
}
.all_listeners {
color: var(--warning-color);
}
@media all and (max-width: 870px) {
.render-pane {
.content ha-card {
max-width: 100%;
}
}
Expand Down

0 comments on commit 150da9c

Please sign in to comment.