Skip to content

Commit 9fa4e05

Browse files
committed
Remove getter for numeric values in mixin
1 parent 13f54ea commit 9fa4e05

File tree

2 files changed

+8
-28
lines changed

2 files changed

+8
-28
lines changed

src/dialogs/more-info/ha-more-info-dialog.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,12 @@ export class MoreInfoDialog extends ScrollableFadeMixin(LitElement) {
128128

129129
@state() private _sensorNumericDeviceClasses?: string[] = [];
130130

131-
private static readonly SCROLL_FADE_THRESHOLD = 24;
131+
protected scrollFadeThreshold = 24;
132132

133133
protected get scrollableElement(): HTMLElement | null {
134134
return this._contentElement;
135135
}
136136

137-
protected get scrollFadeThreshold() {
138-
return MoreInfoDialog.SCROLL_FADE_THRESHOLD;
139-
}
140-
141137
public showDialog(params: MoreInfoDialogParams) {
142138
this._entityId = params.entityId;
143139
if (!this._entityId) {

src/mixins/scrollable-fade-mixin.ts

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -48,40 +48,24 @@ export const ScrollableFadeMixin = <T extends Constructor<LitElement>>(
4848
});
4949

5050
/**
51-
* The default safe area padding for the scrollable element.
51+
* Safe area padding in pixels for the scrollable element.
5252
*/
53-
private static readonly DEFAULT_SAFE_AREA_PADDING = 16;
53+
protected scrollFadeSafeAreaPadding = 16;
5454

5555
/**
56-
* The default scroll threshold for the scrollable element.
56+
* Scroll threshold in pixels for showing the fades.
5757
*/
58-
private static readonly DEFAULT_SCROLL_THRESHOLD = 4;
58+
protected scrollFadeThreshold = 4;
5959

6060
/**
61-
* The default scrollable element.
61+
* Default scrollable element value.
6262
*/
6363
private static readonly DEFAULT_SCROLLABLE_ELEMENT: HTMLElement | null =
6464
null;
6565

6666
/**
67-
* Safe area padding in pixels for scrollable calculations. Override to customize.
68-
* @returns Safe area padding value in pixels.
69-
*/
70-
protected get scrollFadeSafeAreaPadding() {
71-
return ScrollableFadeClass.DEFAULT_SAFE_AREA_PADDING;
72-
}
73-
74-
/**
75-
* Scroll threshold in pixels for showing the top fade. Override to customize.
76-
* @returns Scroll threshold value in pixels.
77-
*/
78-
protected get scrollFadeThreshold() {
79-
return ScrollableFadeClass.DEFAULT_SCROLL_THRESHOLD;
80-
}
81-
82-
/**
83-
* Element to observe for scroll and resize events. Override to specify target.
84-
* @returns The element to observe, or null.
67+
* Element to observe for scroll and resize events. Override with a getter to specify target.
68+
* Kept as a getter to allow subclasses to return query results.
8569
*/
8670
protected get scrollableElement(): HTMLElement | null {
8771
return ScrollableFadeClass.DEFAULT_SCROLLABLE_ELEMENT;

0 commit comments

Comments
 (0)