22 lines
489 B
JavaScript
22 lines
489 B
JavaScript
|
|
Object.defineProperty(window.top.PWR_Percents,'name', { //.frames[0]
|
||
|
|
get: function () {
|
||
|
|
return name;
|
||
|
|
},
|
||
|
|
set: function (newValue) {
|
||
|
|
name = newValue;
|
||
|
|
modifyStyle();
|
||
|
|
}
|
||
|
|
});
|
||
|
|
|
||
|
|
function modifyStyle(){
|
||
|
|
let electricity = window.top.PWR_Percents;
|
||
|
|
$(".btn").removeClass('disabledBtn remindBtn');
|
||
|
|
console.log("electricity",electricity)
|
||
|
|
if(electricity <= 20){
|
||
|
|
$(".btn").addClass('disabledBtn');
|
||
|
|
}
|
||
|
|
if(electricity <= 30){
|
||
|
|
$(".btn").addClass('remindBtn');
|
||
|
|
}
|
||
|
|
}
|