Fossil SCM

Use the innerHTML method rather than setAttribute to add DIV elements for graphics, in an effort to get graphs to work with IE.

drh 2010-02-08 18:48 trunk
Commit 4e8c30c354d5e3d4ab6d1de0c3ca2753d242aba3
1 file changed +3 -5
+3 -5
--- src/timeline.c
+++ src/timeline.c
@@ -251,11 +251,11 @@
251251
}
252252
memcpy(zTime, &zDate[11], 5);
253253
zTime[5] = 0;
254254
@ <tr>
255255
@ <td valign="top" align="right">%s(zTime)</td>
256
- @ <td width="20" align="center" valign="top">
256
+ @ <td width="20" align="left" valign="top">
257257
@ <div id="m%d(rid)"></div>
258258
if( zBgClr && zBgClr[0] ){
259259
@ <td valign="top" align="left" bgcolor="%h(zBgClr)">
260260
}else{
261261
@ <td valign="top" align="left">
@@ -401,18 +401,16 @@
401401
@ var n = document.createElement("div");
402402
@ if( x0>x1 ){ var t=x0; x0=x1; x1=t; }
403403
@ if( y0>y1 ){ var t=y0; y0=y1; y1=t; }
404404
@ var w = x1-x0+1;
405405
@ var h = y1-y0+1;
406
- @ n.setAttribute("style",
407
- @ "position:absolute;"+
406
+ @ n.innerHTML="<div style=\"position:absolute;overflow:hidden;"+
408407
@ "left:"+x0+"px;"+
409408
@ "top:"+y0+"px;"+
410409
@ "width:"+w+"px;"+
411410
@ "height:"+h+"px;"+
412
- @ "background-color:"+color+";"
413
- @ );
411
+ @ "background-color:"+color+";\"></div>"
414412
@ canvasDiv.appendChild(n);
415413
@ }
416414
@ function absoluteY(id){
417415
@ var obj = document.getElementById(id);
418416
@ if( !obj ) return;
419417
--- src/timeline.c
+++ src/timeline.c
@@ -251,11 +251,11 @@
251 }
252 memcpy(zTime, &zDate[11], 5);
253 zTime[5] = 0;
254 @ <tr>
255 @ <td valign="top" align="right">%s(zTime)</td>
256 @ <td width="20" align="center" valign="top">
257 @ <div id="m%d(rid)"></div>
258 if( zBgClr && zBgClr[0] ){
259 @ <td valign="top" align="left" bgcolor="%h(zBgClr)">
260 }else{
261 @ <td valign="top" align="left">
@@ -401,18 +401,16 @@
401 @ var n = document.createElement("div");
402 @ if( x0>x1 ){ var t=x0; x0=x1; x1=t; }
403 @ if( y0>y1 ){ var t=y0; y0=y1; y1=t; }
404 @ var w = x1-x0+1;
405 @ var h = y1-y0+1;
406 @ n.setAttribute("style",
407 @ "position:absolute;"+
408 @ "left:"+x0+"px;"+
409 @ "top:"+y0+"px;"+
410 @ "width:"+w+"px;"+
411 @ "height:"+h+"px;"+
412 @ "background-color:"+color+";"
413 @ );
414 @ canvasDiv.appendChild(n);
415 @ }
416 @ function absoluteY(id){
417 @ var obj = document.getElementById(id);
418 @ if( !obj ) return;
419
--- src/timeline.c
+++ src/timeline.c
@@ -251,11 +251,11 @@
251 }
252 memcpy(zTime, &zDate[11], 5);
253 zTime[5] = 0;
254 @ <tr>
255 @ <td valign="top" align="right">%s(zTime)</td>
256 @ <td width="20" align="left" valign="top">
257 @ <div id="m%d(rid)"></div>
258 if( zBgClr && zBgClr[0] ){
259 @ <td valign="top" align="left" bgcolor="%h(zBgClr)">
260 }else{
261 @ <td valign="top" align="left">
@@ -401,18 +401,16 @@
401 @ var n = document.createElement("div");
402 @ if( x0>x1 ){ var t=x0; x0=x1; x1=t; }
403 @ if( y0>y1 ){ var t=y0; y0=y1; y1=t; }
404 @ var w = x1-x0+1;
405 @ var h = y1-y0+1;
406 @ n.innerHTML="<div style=\"position:absolute;overflow:hidden;"+
 
407 @ "left:"+x0+"px;"+
408 @ "top:"+y0+"px;"+
409 @ "width:"+w+"px;"+
410 @ "height:"+h+"px;"+
411 @ "background-color:"+color+";\"></div>"
 
412 @ canvasDiv.appendChild(n);
413 @ }
414 @ function absoluteY(id){
415 @ var obj = document.getElementById(id);
416 @ if( !obj ) return;
417

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button