Skip to content

Commit

Permalink
Fix hide_on_click
Browse files Browse the repository at this point in the history
  • Loading branch information
amaximus committed Mar 15, 2023
1 parent e4cef56 commit b6e1680
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
14 changes: 8 additions & 6 deletions dist/garbage-collection-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class GarbageCollectionCard extends HTMLElement {
friendly_name: entityState.attributes['friendly_name'],
next_date: next_date,
days: days,
daysstr: days,
icon: entityState.attributes['icon'],
alerted: alerted,
last_collection: entityState.attributes['last_collection'] || null,
Expand All @@ -39,6 +40,7 @@ class GarbageCollectionCard extends HTMLElement {
friendly_name: '',
next_date: '',
days: '',
daysstr: '',
icon: '',
alerted: '',
last_collection: null,
Expand Down Expand Up @@ -168,12 +170,12 @@ class GarbageCollectionCard extends HTMLElement {
} else {
root.getElementById('details').innerHTML = (hdate === false ? attributes.next_date : '') +
(hdow === false ? ' ' + attributes.dow + (hdays === false ? ',' : '') : '' ) +
(hdays === false ? ' ' + attributes.days : '' )
(hdays === false ? ' ' + attributes.daysstr : '' )
}
} else {
root.getElementById('details').innerHTML = (hdate === false ? attributes.next_date : '') +
(hdow === false ? ' ' + attributes.dow + (hdays === false ? ',' : '') : '' ) +
(hdays === false ? ' ' + attributes.days : '' )
(hdays === false ? ' ' + attributes.daysstr : '' )
}
if ( hdays === true && hdate === true && duetxt === false && hdow === true ) {
root.getElementById('details').style.display = "none";
Expand Down Expand Up @@ -294,18 +296,18 @@ class GarbageCollectionCard extends HTMLElement {
} else {
if ( typeof this.translationJSONobj != "undefined"
&& typeof this.translationJSONobj.other['in_days'] !== "undefined" ) {
attributes.days = this.translationJSONobj.other['in_days'].replace('DAYS', attributes.days);
attributes.daysstr = this.translationJSONobj.other['in_days'].replace('DAYS', attributes.days);
} else {
attributes.days = `in ${attributes.days} days`;
attributes.daysstr = `in ${attributes.days} days`;
}
}
}
} else { // attributes.days >= 2
if ( typeof this.translationJSONobj != "undefined"
&& typeof this.translationJSONobj.other['in_days'] !== "undefined" ) {
attributes.days = this.translationJSONobj.other['in_days'].replace('DAYS', attributes.days);
attributes.daysstr = this.translationJSONobj.other['in_days'].replace('DAYS', attributes.days);
} else {
attributes.days = `in ${attributes.days} days`;
attributes.daysstr = `in ${attributes.days} days`;
}
}
}
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.23.1",
"updated_at": "2023-03-14",
"version": "1.23.2",
"updated_at": "2023-03-15",
"visit_repo": "https://github.com/amaximus/garbage-collection-card",
"changelog": "https://github.com/amaximus/garbage-collection-card/releases/1.23.1"
"changelog": "https://github.com/amaximus/garbage-collection-card/releases/1.23.2"
}
}

0 comments on commit b6e1680

Please sign in to comment.