Longpoll will update dropdown and readings, mainly by Matthias

git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@2545 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2013-01-21 20:22:39 +00:00
parent 21533adc75
commit 29b1af6f1a
2 changed files with 34 additions and 9 deletions

View File

@@ -34,8 +34,18 @@ FW_doUpdate()
if(d.length != 3)
continue;
var el = document.getElementById(d[0]);
if(el)
el.innerHTML=d[2];
if(el) {
if(el.nodeName.toLowerCase() == "select") {
// dropdown: set the selected index to the current value
for(var j=0;j<el.options.length;j++)
if(el.options[j].value == d[2]) {
el.selectedIndex = j;
}
} else {
el.innerHTML=d[2];
}
}
}
//Next time, we continue at the next line
FW_curLine = lines.length;