Skip to content

Commit e862a92

Browse files
authored
feat: added cardHeight option (#442)
1 parent 2059fa5 commit e862a92

File tree

8 files changed

+31
-6
lines changed

8 files changed

+31
-6
lines changed

dist/atomic-calendar-revive.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/options/calendar-mode-options.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ nav_order: 4
1717
| disableCalLocationLink | boolean | v1.5.0 | `false` If true the link will be disabled on the event location icon for the selected day |
1818
| calShowDescription | boolean | v2.5.0 | `false` If true this will display the description in calendar mode |
1919
| disableCalLink | boolean | v3.0.0 | `false` If true the link to google calendar will be removed |
20+
| cardHeight | string | v4.3.0 | `100%` Change to `px` or `%` to set the height of the card, this will add scroll if it is too small |
2021

2122
## Color Options
2223

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "atomic-calendar-revive",
3-
"version": "4.2.1",
4-
"editor_version": "1.5.0",
3+
"version": "4.3.0",
4+
"editor_version": "1.6.0",
55
"description": "Calendar Card for Home Assistant",
66
"main": "atomic-calendar-revive.js",
77
"scripts": {

src/defaults.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { localize } from './localize/localize';
22

33
export default {
4+
cardHeight: "100%",
5+
46
// text translations
57
fullDayEventText: localize('common.fullDayEventText'), // "All day" custom text
68
untilText: localize('common.untilText'), // "Until" custom text

src/index-editor.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ export class AtomicCalendarReviveEditor extends LitElement implements LovelaceCa
8787
}
8888
return 'Events';
8989
}
90+
get _cardHeight(): string {
91+
if (this._config) {
92+
return this._config.cardHeight || '100%';
93+
}
94+
return '100%';
95+
}
9096

9197
get _showLocation(): boolean {
9298
if (this._config) {
@@ -413,6 +419,18 @@ export class AtomicCalendarReviveEditor extends LitElement implements LovelaceCa
413419
})}
414420
</paper-listbox> </paper-dropdown-menu
415421
><br />
422+
<div class="side-by-side">
423+
<div>
424+
<paper-input
425+
label="${localize('main.fields.cardHeight')}"
426+
.value=${this._cardHeight}
427+
.configValue=${'cardHeight'}
428+
@value-changed=${this._valueChanged}
429+
></paper-input>
430+
</div>
431+
<div>
432+
</div>
433+
</div>
416434
<div class="side-by-side">
417435
<div>
418436
<ha-switch

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ class AtomicCalendarRevive extends LitElement {
294294
.cal-card {
295295
cursor: default;
296296
padding: 16px;
297+
height: ${this._config.cardHeight};
298+
overflow: auto;
297299
}
298300
299301
.cal-name {
@@ -671,6 +673,7 @@ class AtomicCalendarRevive extends LitElement {
671673
// The height of your card. Home Assistant uses this to automatically
672674
// distribute all cards over the available columns.
673675
getCardSize() {
676+
674677
return this._config.entities.length + 1;
675678
}
676679

src/localize/languages/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
"linkTarget": "Link target",
4545
"refreshInterval": "Refresh Interval",
4646
"showRelativeTime": "Show Relative Time",
47-
"firstDayOfWeek": "First Day of Week 0-6"
47+
"firstDayOfWeek": "First Day of Week 0-6",
48+
"cardHeight": "Card Height"
4849
}
4950
},
5051
"event": {

tracker.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"atomic-calendar-revive": {
3-
"updated_at": "2021-06-09",
4-
"version": "4.2.1",
3+
"updated_at": "2021-06-11",
4+
"version": "4.3.0",
55
"remote_location": "https://github.com/marksie1988/atomic-calendar-revive/releases/latest/dist/atomic-calendar-revive.js",
66
"visit_repo": "https://github.com/marksie1988/atomic-calendar-revive",
77
"changelog": "https://github.com/marksie1988/atomic-calendar-revive/releases/latest"

0 commit comments

Comments
 (0)