Skip to content

Commit

Permalink
Changed class name for slider container and added colorMode key to re…
Browse files Browse the repository at this point in the history
…adme for slider-v2.
  • Loading branch information
AnthonMS committed Aug 9, 2022
1 parent 6a9efcd commit 4dfb2a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/cards/slider-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ It is completely customizable now and fully templatable.
| ---- | ---- | ------- | ----------- |
| type | string | **Required** | `custom:my-slider-v2` |
| entity | string | **Required** | `light.livingroom` |
| colorMode | string | brightness | Can be brightness, temperature, hue, saturation |
| vertical | boolean | false | This will set the slider to be vertical and handled from bottom to top. Default on covers |
| flipped | boolean | false | This will just flip the slider to go from right to left or top to bottom. Default on covers |
| inverse | boolean | false | Will inverse how far the slider has progressed compared to value. so if brightness is 75%, then it will only be 25% progressed. This is useful for cover, where it is Default. |
Expand Down
6 changes: 3 additions & 3 deletions src/cards/my-slider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export class MySliderV2 extends LitElement {
}

const setElements = (event) => {
const sliderMaybe = event.composedPath().find(el => el.classList.contains('my-slider-custom'))
const sliderMaybe = event.composedPath().find(el => el.classList.contains('my-slider-custom-container'))
if (!sliderMaybe) {
this.sliderEl = event.target
}
Expand Down Expand Up @@ -262,8 +262,8 @@ export class MySliderV2 extends LitElement {

this.createAndCleanupEventListeners(sliderHandler)
return html`
<ha-card style="${styleMap(cardStl)}">
<div class="my-slider-custom" id="${this.sliderId}" style="${styleMap(containerStl)}" data-value="${this.sliderVal}" data-progress-percent="${this.sliderValPercent}"
<ha-card class="my-slider-custom-card" style="${styleMap(cardStl)}">
<div class="my-slider-custom-container" id="${this.sliderId}" style="${styleMap(containerStl)}" data-value="${this.sliderVal}" data-progress-percent="${this.sliderValPercent}"
@mousedown="${sliderHandler}"
@mouseup="${sliderHandler}"
@mousemove="${sliderHandler}"
Expand Down

0 comments on commit 4dfb2a3

Please sign in to comment.