Skip to content

Commit

Permalink
Update fan-percent-button-row.js
Browse files Browse the repository at this point in the history
  • Loading branch information
finity69x2 authored Mar 24, 2021
1 parent fee8733 commit 79ae4f1
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions dist/fan-percent-button-row.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ class CustomFanPercentRow extends Polymer.Element {
line-height: inherit;
}
.percentage {
min-width: 30px;
max-width: 30px;
height: 30px;
margin-left: 2px;
margin-right: 2px;
background-color: #759aaa;
Expand All @@ -29,25 +26,25 @@ class CustomFanPercentRow extends Polymer.Element {
<div class='horizontal justified layout' on-click="stopPropagation">
<button
class='percentage'
style='[[_leftColor]]'
style='[[_leftColor]];min-width:[[_width]];max-width:[[_width]];height:[[_height]]'
toggles name="[[_leftName]]"
on-click='setPercentage'
disabled='[[_leftState]]'>[[_leftText]]</button>
<button
class='percentage'
style='[[_midLeftColor]]'
style='[[_midLeftColor]];min-width:[[_width]];max-width:[[_width]];height:[[_height]]'
toggles name="[[_midLeftName]]"
on-click='setPercentage'
disabled='[[_midLeftState]]'>[[_midLeftText]]</button>
<button
class='percentage'
style='[[_midRightColor]]'
style='[[_midRightColor]];min-width:[[_width]];max-width:[[_width]];height:[[_height]]'
toggles name="[[_midRightName]]"
on-click='setPercentage'
disabled='[[_midRightState]]'>[[_midRightText]]</button>
<button
class='percentage'
style='[[_rightColor]]'
style='[[_rightColor]];min-width:[[_width]];max-width:[[_width]];height:[[_height]]'
toggles name="[[_rightName]]"
on-click='setPercentage'
disabled='[[_rightState]]'>[[_rightText]]</button>
Expand All @@ -68,6 +65,8 @@ class CustomFanPercentRow extends Polymer.Element {
_lowSP: Number,
_medSP: Number,
_highSP: Number,
_width: String,
_height: String,
_leftColor: String,
_midLeftColor: String,
_midRightColor: String,
Expand Down Expand Up @@ -99,6 +98,8 @@ class CustomFanPercentRow extends Polymer.Element {
lowPercentage: 33,
medPercentage: 66,
hiPercentage: 100,
width: '30px',
height: '30px',
isOffColor: '#f44c09',
isOnLowColor: '#43A047',
isOnMedColor: '#43A047',
Expand All @@ -119,6 +120,8 @@ class CustomFanPercentRow extends Polymer.Element {
const custTheme = config.customTheme;
const custSetpoint = config.customSetpoints;
const revButtons = config.reverseButtons;
const buttonWidth = config.width;
const buttonHeight = config.height;
const OnLowClr = config.isOnLowColor;
const OnMedClr = config.isOnMedColor;
const OnHiClr = config.isOnHiColor;
Expand Down Expand Up @@ -237,7 +240,10 @@ class CustomFanPercentRow extends Polymer.Element {
let offtext = custOffTxt;
let lowtext = custLowTxt;
let medtext = custMedTxt;
let hitext = custHiTxt;
let hitext = custHiTxt;

let buttonwidth = buttonWidth;
let buttonheight = buttonHeight;

let offname = 'off'
let lowname = 'low'
Expand All @@ -251,6 +257,8 @@ class CustomFanPercentRow extends Polymer.Element {
_midLeftState: low === 'on',
_midRightState: med === 'on',
_rightState: high === 'on',
_width: buttonwidth,
_height: buttonheight,
_leftColor: offcolor,
_midLeftColor: lowcolor,
_midRightColor: medcolor,
Expand All @@ -276,6 +284,8 @@ class CustomFanPercentRow extends Polymer.Element {
_midLeftState: med === 'on',
_midRightState: low === 'on',
_rightState: offstate === 'on',
_width: buttonwidth,
_height: buttonheight,
_leftColor: hicolor,
_midLeftColor: medcolor,
_midRightColor: lowcolor,
Expand Down

0 comments on commit 79ae4f1

Please sign in to comment.