mirror of
https://github.com/shouptech/tempgopher.git
synced 2026-02-03 08:39:43 +00:00
Don't show config options if one is disabled
This commit is contained in:
parent
0bd6c9bf73
commit
bdba7afbfd
1 changed files with 16 additions and 5 deletions
|
|
@ -118,8 +118,18 @@ function renderThermostats() {
|
|||
var hmIn = $("<input>").attr("id", "hm" + configData.alias).val(configData.heatminutes).attr("size", "2").attr("pattern", rp).on('input', function(){window.clearInterval(rtHandle)});
|
||||
var ltIn = $("<input>").attr("id", "lt" + configData.alias).val(lowtemp).attr("size", "4").attr("pattern", rp).on('input', function(){window.clearInterval(rtHandle)});
|
||||
|
||||
var configp = $("<p></p>").text("Chills for ").append(cmIn).append(" minutes when > ").append(htIn).append(degUnit).append($("<br>"));
|
||||
configp.append("Heats for ").append(hmIn).append(" minutes when < ").append(ltIn).append(degUnit);
|
||||
var configp = $("<p></p>")
|
||||
if (!configData.cooldisable) {
|
||||
configp.append("Chills for ").append(cmIn).append(" minutes when > ").append(htIn).append(degUnit);
|
||||
}
|
||||
|
||||
if (!configData.cooldisable && !configData.heatdisable){
|
||||
configp.append($("<br>"));
|
||||
}
|
||||
|
||||
if (!configData.heatdisable) {
|
||||
configp.append("Heats for ").append(hmIn).append(" minutes when < ").append(ltIn).append(degUnit);
|
||||
}
|
||||
|
||||
var configdiv = $("<div></div>").addClass("five columns").append(configp);
|
||||
rowdiv.append(configdiv);
|
||||
|
|
@ -159,9 +169,10 @@ function renderThermostats() {
|
|||
renderThermostats();
|
||||
});
|
||||
|
||||
var buttonDiv = $("<div></div>").addClass("three columns").append(yesButton).append(noButton);
|
||||
rowdiv.append(buttonDiv);
|
||||
//var confForm = $("<form></form>").append(rowdiv);
|
||||
if (!configData.heatdisable || !configData.cooldisable) {
|
||||
var buttonDiv = $("<div></div>").addClass("three columns").append(yesButton).append(noButton);
|
||||
rowdiv.append(buttonDiv);
|
||||
}
|
||||
|
||||
// Add things back to the thermostat list
|
||||
$("#thermostats").append(titlediv);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue