Skip to content

Commit

Permalink
Merge pull request #17 from custom-cards/dev
Browse files Browse the repository at this point in the history
0.0.6
  • Loading branch information
ofekashery authored Aug 6, 2018
2 parents 3907f18 + b3272a6 commit 95dfbd3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.5
0.0.6
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.0.6
- Closing issue [#16](https://github.com/custom-cards/vertical-stack-in-card/issues/16)

## 0.0.5
- Closing issue [#13](https://github.com/custom-cards/vertical-stack-in-card/issues/13)
- Fix the padding of the cards
Expand Down
12 changes: 3 additions & 9 deletions vertical-stack-in-card.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
class VerticalStackInCard extends HTMLElement {
constructor() {
super();
this._items = 0;
// Make use of shadowRoot to avoid conflicts when reusing
this.attachShadow({ mode: 'open' });
}
Expand All @@ -12,16 +11,14 @@ class VerticalStackInCard extends HTMLElement {

this.style.boxShadow = "0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.15)";
this.style.borderRadius = "2px";
this.style.paddingBottom = "16px";
this.style.background = "var(--paper-card-background-color)";

const root = this.shadowRoot;
while (root.lastChild) {
root.removeChild(root.lastChild);
}

const cardConfig = Object.assign({}, config);
this._refCards = []
this._refCards = [];
if (config.title) {
const title = document.createElement("div");
title.className = "header";
Expand All @@ -40,7 +37,6 @@ class VerticalStackInCard extends HTMLElement {
root.appendChild(element);
this._refCards.push(element);
});
this._config = cardConfig;
}

set hass(hass) {
Expand All @@ -55,19 +51,17 @@ class VerticalStackInCard extends HTMLElement {
this._refCards.forEach((element) => {
if (element.shadowRoot) {
if (!element.shadowRoot.querySelector('ha-card')) {
var searchEles = element.shadowRoot.getElementById("root");
let searchEles = element.shadowRoot.getElementById("root");
if (!searchEles) {
searchEles = element.shadowRoot.getElementById("card");
}
searchEles = searchEles.childNodes;
for(var i = 0; i < searchEles.length; i++) {
for(let i = 0; i < searchEles.length; i++) {
searchEles[i].style.margin = "0px";
searchEles[i].shadowRoot.querySelector('ha-card').style.boxShadow = 'none';
searchEles[i].shadowRoot.querySelector('ha-card').style.paddingBottom = '0px';
}
} else {
element.shadowRoot.querySelector('ha-card').style.boxShadow = 'none';
element.shadowRoot.querySelector('ha-card').style.paddingBottom = '0px';
}
}
});
Expand Down

0 comments on commit 95dfbd3

Please sign in to comment.