mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-20 07:16:03 +00:00
Take first number for the slider.
git-svn-id: https://svn.fhem.de/fhem/trunk@2806 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
f47c72cf0e
commit
8fd8251d2b
@ -1087,7 +1087,7 @@ FW_showRoom()
|
||||
my $srf = $FW_room ? "&room=$FW_room" : "";
|
||||
my $cv = ReadingsVal($d, $cmd, Value($d));
|
||||
$cmd = "" if($cmd eq "state");
|
||||
$cv =~ s/[^\d\.]//g; # remove non numbers
|
||||
$cv =~ s/.*?(\d+).*/$1/; # get first number
|
||||
FW_pO "<td colspan='2'>".
|
||||
"<div class='slider' id='slider.$d' ".
|
||||
"min='$min' stp='$stp' max='$max' ".
|
||||
|
@ -52,16 +52,14 @@ FW_doUpdate()
|
||||
el = document.getElementById("slider."+d[0]);
|
||||
if(el) {
|
||||
var doSet = 1; // Only set the "state" slider in the detail view
|
||||
/*
|
||||
if(el.parentNode.getAttribute("name") == "val.set"+d[0]) {
|
||||
var el2 = document.getElementsByName("arg.set"+d[0])[0];
|
||||
if(el2.nodeName.toLowerCase() == "select" &&
|
||||
el2.options[el2.selectedIndex].value != "state")
|
||||
doSet = 0;
|
||||
}
|
||||
*/
|
||||
if(doSet) {
|
||||
var val = d[1].replace(/[^\d\.]/g, ""); // remove non numbers
|
||||
var val = d[1].replace(/^.*?(\d+).*/g, "$1"); // get first number
|
||||
Slider(el, val);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user