web: fix tabs detecting all slot elements

This commit is contained in:
Jens Langhammer 2021-01-16 23:04:08 +01:00
parent b81f3e4a38
commit 6495d6c50a
2 changed files with 5 additions and 5 deletions

View File

@ -28,7 +28,7 @@ export class Tabs extends LitElement {
} }
render(): TemplateResult { render(): TemplateResult {
const pages = Array.from(this.querySelectorAll("[slot]")); const pages = Array.from(this.querySelectorAll("[slot^='page-']"));
if (!this.currentPage) { if (!this.currentPage) {
if (pages.length < 1) { if (pages.length < 1) {
return html`<h1>${gettext("no tabs defined")}</h1>`; return html`<h1>${gettext("no tabs defined")}</h1>`;

View File

@ -34,8 +34,8 @@ export class LibraryApplication extends LitElement {
return html` <a href="${this.application.launch_url}" class="pf-c-card pf-m-hoverable pf-m-compact"> return html` <a href="${this.application.launch_url}" class="pf-c-card pf-m-hoverable pf-m-compact">
<div class="pf-c-card__header"> <div class="pf-c-card__header">
${this.application.meta_icon ${this.application.meta_icon
? html`<img class="app-icon pf-c-avatar" src="${ifDefined(this.application.meta_icon)}" alt="Application Icon"/>` ? html`<img class="app-icon pf-c-avatar" src="${ifDefined(this.application.meta_icon)}" alt="Application Icon"/>`
: html`<i class="pf-icon pf-icon-arrow"></i>`} : html`<i class="pf-icon pf-icon-arrow"></i>`}
</div> </div>
<div class="pf-c-card__title"> <div class="pf-c-card__title">
<p id="card-1-check-label">${this.application.name}</p> <p id="card-1-check-label">${this.application.name}</p>
@ -92,8 +92,8 @@ export class LibraryPage extends LitElement {
</section> </section>
<section class="pf-c-page__main-section"> <section class="pf-c-page__main-section">
${loading(this.apps, html`${(this.apps?.results.length || 0) > 0 ? ${loading(this.apps, html`${(this.apps?.results.length || 0) > 0 ?
this.renderApps() : this.renderApps() :
this.renderEmptyState()}`)} this.renderEmptyState()}`)}
</section> </section>
</main>`; </main>`;
} }