mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
fhemweb.js: fix colspan adjusting for tables (Forum #74849)
git-svn-id: https://svn.fhem.de/fhem/trunk@14827 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
db00c087f1
commit
dd8719f87c
@ -930,9 +930,10 @@ FW_answerCall($)
|
|||||||
$FW_lastHashUpdate = $lastDefChange;
|
$FW_lastHashUpdate = $lastDefChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $t = AttrVal($FW_wname, "title",
|
my $hsh = "Home, Sweet Home";
|
||||||
AttrVal("global", "title", "Home, Sweet Home"));
|
my $t = AttrVal($FW_wname, "title", AttrVal("global", "title", $hsh));
|
||||||
$t = eval $t if($t =~ m/^{.*}$/s); # Forum #48668
|
$t = eval $t if($t =~ m/^{.*}$/s); # Forum #48668
|
||||||
|
$t = $hsh if(!defined($t));
|
||||||
|
|
||||||
|
|
||||||
FW_pO '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" '.
|
FW_pO '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" '.
|
||||||
|
@ -111,15 +111,23 @@ FW_jqueryReadyFn()
|
|||||||
var id = $(this).attr("id");
|
var id = $(this).attr("id");
|
||||||
if(!id || id.indexOf("TYPE") != 0)
|
if(!id || id.indexOf("TYPE") != 0)
|
||||||
return;
|
return;
|
||||||
var maxTd=0, tdCount=[];
|
var maxTd=0, tdCount=[], tbl = $(this);
|
||||||
$(this).find("tr").each(function(){ // count the td's
|
$(tbl).find("> tbody > tr").each(function(){ // count the td's
|
||||||
var cnt=0;
|
var cnt = 0, row=this;
|
||||||
$(this).find("td").each(function(){ cnt++; });
|
$(row).find("> td").each(function(){
|
||||||
if(maxTd < cnt) maxTd = cnt;
|
var cs = $(this).attr("colspan");
|
||||||
|
cnt += parseInt(cs ? cs : 1);
|
||||||
|
});
|
||||||
|
if(maxTd < cnt)
|
||||||
|
maxTd = cnt;
|
||||||
tdCount.push(cnt);
|
tdCount.push(cnt);
|
||||||
});
|
});
|
||||||
$(this).find("tr").each(function(){ // set the colspan
|
$(tbl).find("> tbody> tr").each(function(){ // set the colspan
|
||||||
$(this).find("td").last().attr("colspan", maxTd-tdCount.shift()+1);
|
var tdc = tdCount.shift();
|
||||||
|
$(this).find("> td:last").each(function(){
|
||||||
|
var cs = $(this).attr("colspan");
|
||||||
|
$(this).attr("colspan", maxTd-tdc+(cs ? parseInt(cs) : 1));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user