2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-22 02:10:32 +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:
rudolfkoenig 2013-02-25 13:02:45 +00:00
parent f47c72cf0e
commit 8fd8251d2b
2 changed files with 2 additions and 4 deletions

View File

@ -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' ".

View File

@ -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);
}
}