2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

fhemweb.js: make #FHEMWEB: eval more flexible (Forum #87583)

git-svn-id: https://svn.fhem.de/fhem/trunk@16697 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2018-05-07 15:41:00 +00:00
parent 918395b418
commit 53705f24b0

View File

@ -989,10 +989,9 @@ FW_doUpdate(evt)
if(d.length != 3)
continue;
if( d[0].match(/^#FHEMWEB:/) ) {
eval(d[1]);
} else {
function
setValue(d) // is Callable from eval below
{
$("[informId='"+d[0]+"']").each(function(){
if(this.setValueFn) { // change the select/etc value
this.setValueFn(d[1].replace(/\n/g, '\u2424'));
@ -1016,6 +1015,13 @@ FW_doUpdate(evt)
});
}
if( d[0].match(/^#FHEMWEB:/) ) {
eval(d[1]);
} else {
setValue(d);
}
// updateLine is deprecated, use setValueFn
for(var w in FW_widgets)
if(FW_widgets[w].updateLine && !FW_widgets[w].second)