Fix: Horizontal mode not working if count not specified

pull/72/head
Juraj Nyíri 3 years ago
parent 34852a3070
commit 1ced6d8db3

@ -22384,11 +22384,10 @@ class PlexMeetsHomeAssistant extends HTMLElement {
let itemsPerRow = this.data[this.config.libraryName].length; let itemsPerRow = this.data[this.config.libraryName].length;
if (this.maxCount) { if (this.maxCount) {
maxRenderedItems = this.maxCount; maxRenderedItems = this.maxCount;
itemsPerRow = maxRenderedItems; }
if (this.maxRows) { itemsPerRow = maxRenderedItems;
itemsPerRow = Math.ceil(maxRenderedItems / this.maxRows); if (this.maxRows) {
} itemsPerRow = Math.ceil(maxRenderedItems / this.maxRows);
console.log(itemsPerRow);
} }
// eslint-disable-next-line consistent-return // eslint-disable-next-line consistent-return
const searchValues = lodash.split(this.searchValue, ' '); const searchValues = lodash.split(this.searchValue, ' ');

@ -614,11 +614,10 @@ class PlexMeetsHomeAssistant extends HTMLElement {
let itemsPerRow = this.data[this.config.libraryName].length; let itemsPerRow = this.data[this.config.libraryName].length;
if (this.maxCount) { if (this.maxCount) {
maxRenderedItems = this.maxCount; maxRenderedItems = this.maxCount;
itemsPerRow = maxRenderedItems; }
if (this.maxRows) { itemsPerRow = maxRenderedItems;
itemsPerRow = Math.ceil(maxRenderedItems / this.maxRows); if (this.maxRows) {
} itemsPerRow = Math.ceil(maxRenderedItems / this.maxRows);
console.log(itemsPerRow);
} }
// eslint-disable-next-line consistent-return // eslint-disable-next-line consistent-return
const searchValues = _.split(this.searchValue, ' '); const searchValues = _.split(this.searchValue, ' ');

Loading…
Cancel
Save