2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 10:46:53 +00:00

fhemweb.js: FW_replaceWidgets patch for attr (Forum #38169)

git-svn-id: https://svn.fhem.de/fhem/trunk@8756 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2015-06-16 09:14:47 +00:00
parent b6744c9f22
commit ab0f953829

View File

@ -37,11 +37,13 @@ FW_replaceWidgets(parent)
var cmd=$(this).attr("cmd");
var rd=$(this).attr("reading");
var params = cmd.split(" ");
var type=$(this).attr("type");
if( type == undefined ) type = "set";
FW_replaceWidget(this, dev, $(this).attr("arg").split(","),
$(this).attr("current"), rd, params[0], params.slice(1),
function(arg) {
FW_cmd(FW_root+"?cmd=set "+dev+(params[0]=="state" ? "":" "+params[0])+
" "+arg+"&XHR=1");
FW_cmd(FW_root+"?cmd="+type+" "+dev+
(params[0]=="state" ? "":" "+params[0])+" "+arg+"&XHR=1");
});
});
}