Add: Display card title if set

live_tv 2.2
Juraj Nyíri 3 years ago
parent 0a2d122c3d
commit 5ddd0782d8

@ -21338,6 +21338,23 @@ class PlexMeetsHomeAssistant extends HTMLElement {
this.card.style.overflow = 'hidden';
this.card.style.padding = '16px';
this.card.style.paddingRight = '6px';
const titleContainer = document.createElement('h1');
titleContainer.classList.add('card-header');
titleContainer.style.paddingRight = '0px';
titleContainer.style.paddingLeft = '0px';
titleContainer.style.paddingTop = '0px';
titleContainer.style.paddingBottom = '0px';
const titleElem = document.createElement('div');
titleElem.classList.add('name');
titleElem.textContent = this.config.title;
titleContainer.appendChild(titleElem);
if (!lodash.isNil(this.config.title) && !lodash.isEmpty(this.config.title)) {
titleContainer.style.display = 'block';
}
else {
titleContainer.style.display = 'none';
}
this.card.appendChild(titleContainer);
this.card.appendChild(this.searchInput());
if (this.showSearch) {
this.searchInputElem.style.display = 'block';

@ -604,6 +604,27 @@ class PlexMeetsHomeAssistant extends HTMLElement {
this.card.style.padding = '16px';
this.card.style.paddingRight = '6px';
const titleContainer = document.createElement('h1');
titleContainer.classList.add('card-header');
titleContainer.style.paddingRight = '0px';
titleContainer.style.paddingLeft = '0px';
titleContainer.style.paddingTop = '0px';
titleContainer.style.paddingBottom = '0px';
const titleElem = document.createElement('div');
titleElem.classList.add('name');
titleElem.textContent = this.config.title;
titleContainer.appendChild(titleElem);
if (!_.isNil(this.config.title) && !_.isEmpty(this.config.title)) {
titleContainer.style.display = 'block';
} else {
titleContainer.style.display = 'none';
}
this.card.appendChild(titleContainer);
this.card.appendChild(this.searchInput());
if (this.showSearch) {
this.searchInputElem.style.display = 'block';

Loading…
Cancel
Save