Skip to content

Commit

Permalink
Make the whole card clickable
Browse files Browse the repository at this point in the history
  • Loading branch information
amaximus committed Sep 7, 2020
1 parent 49b830c commit 743a5ac
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Garbage collection cards supports some languages and displays the date informati
When garbage-collection sensors are used with verbose_state=True, hide_date and hide_days will be discarded,
taking the information from the sensor's verbose_format.

When garbage collection is planned for today or tomorrow, clicking on the icon you can acknowledge that the
When garbage collection is planned for today or tomorrow, clicking on the card you can acknowledge that the
garbage was prepared or collected and the card will become hidden.

Please add the card to the resources in configuration.yaml:
Expand Down
3 changes: 2 additions & 1 deletion dist/garbage-collection-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ class GarbageCollectionCard extends HTMLElement {
const cardConfig = Object.assign({}, config);

const card = document.createElement('ha-card');
card.id = "ha_card";
this.content = document.createElement('div');
const style = document.createElement('style');
let icon_size = config.icon_size;
Expand Down Expand Up @@ -213,7 +214,7 @@ class GarbageCollectionCard extends HTMLElement {
root.getElementById('ha_icon').icon = attributes[0].icon;
root.getElementById('ha_icon').className = attributes[0].alerted;
if ( parseInt(attributes[0].days) < 2 ) {
root.getElementById('ha_icon').addEventListener('click', this._ackGarbageOut.bind(this));
root.getElementById('ha_card').addEventListener('click', this._ackGarbageOut.bind(this));
}

root.getElementById('friendly_name').innerHTML = attributes[0].friendly_name;
Expand Down
2 changes: 1 addition & 1 deletion info.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Garbage collection cards supports some languages and displays the date informati
When garbage-collection sensors are used with verbose_state=True, hide_date and hide_days will be discarded,
taking the information from the sensor's verbose_format.

When garbage collection is planned for today or tomorrow, clicking on the icon you can acknowledge that the
When garbage collection is planned for today or tomorrow, clicking on the card you can acknowledge that the
garbage was prepared or collected and the card will become hidden.

Please add the card to the resources in configuration.yaml:
Expand Down
6 changes: 3 additions & 3 deletions tracker.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"garbage-collection-card": {
"version": "1.7.1",
"updated_at": "2020-08-30",
"version": "1.8.0",
"updated_at": "2020-09-07",
"visit_repo": "https://github.com/amaximus/garbage-collection-card",
"changelog": "https://github.com/amaximus/garbage-collection0card/releases/1.7.1"
"changelog": "https://github.com/amaximus/garbage-collection0card/releases/1.8.0"
}
}

0 comments on commit 743a5ac

Please sign in to comment.