Timers: Use visibility instead of disabled

The "+/-" chooser is only needed for sunrise/sunset.
Otherwise it's disabled currently.
This works.

But it's a little confusing. Especially, if you first had
"-" there (for sunset) and then switched to normal "time",
then the "-" is still there, but you can't change it,
because it's disabled.

It looks better, if one uses .style.visibility to hide the
element. It doesn't change the layout, just the element
isn't shown.
This commit is contained in:
Christian Tacke 2019-12-08 21:15:45 +01:00
parent 065ed79c61
commit 531d36e012
1 changed files with 2 additions and 2 deletions

View File

@ -554,10 +554,10 @@ const char HTTP_TIMER_SCRIPT2[] PROGMEM =
"o=qs('#ho');"
"e=o.childElementCount;"
"if(b==1){"
"qs('#dr').disabled='';"
"qs('#dr').style.visibility='';"
"if(e>12){for(i=12;i<=23;i++){o.removeChild(o.lastElementChild);}}" // Create offset hours select options
"}else{"
"qs('#dr').disabled='disabled';"
"qs('#dr').style.visibility='hidden';"
"if(e<23){for(i=12;i<=23;i++){ce(i,o);}}" // Create hours select options
"}"
"}";