Changeset 13845
- Timestamp:
- 05/23/12 19:33:47 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/www/smartfact/index.js
r13804 r13845 232 232 { 233 233 var z = $("body").getAttribute("data-visible"); 234 235 //$("table"+z).style.width="100%"; 236 $("image"+z).style.width="1px"; 237 $("canvas"+z).width=1; 238 234 239 doresize(z); 240 235 241 } 236 242 … … 351 357 /*table.width = "100%";*/ 352 358 //table.setAttribute("style", "overflow:hidden;position:fixed;top:0px;left:"+window.innerWidth+"px;"); 353 table.setAttribute("style", "position:absolute;top:0px;left:"+window.innerWidth+"px; ");359 table.setAttribute("style", "position:absolute;top:0px;left:"+window.innerWidth+"px;width:100%;"); 354 360 355 361 // ----------------------------------------------------- … … 589 595 td2.setAttribute("class", "tcol2"); 590 596 td2.width = "18px"; 597 591 598 if (valid(cols[3])) 592 599 { … … 609 616 610 617 var cell2 = document.createElement("td"); 611 cell2.setAttribute("class", "tcell2");618 cell2.setAttribute("class", valid(cols[1]) ? "tcell2" : "tcell2l"); 612 619 613 620 if (check.length==0 || check[0]!="input") … … 700 707 } 701 708 702 function resizeimpl(z, cnt) 703 { 704 // 393 / 482 488/482 / 200 200+482-488 709 function doresize(z) 710 { 705 711 var img = $("image"+z); 706 712 var canv = $("canvas"+z); … … 718 724 var H = fixedh>0 ? fixedh : window.innerHeight; 719 725 720 $("table"+z).style.width = W+"px"; 721 722 /* 723 if (W==0 || H==0) 724 { 725 var w = $("table"+z).offsetWidth; 726 img.style.width = w+"px"; 727 img.style.height= w+"px"; 728 729 canv.width = w; 730 canv.height = w; 731 return; 732 } 733 */ 726 //alert(window.innerWidth+"/"+$("body").scrollWidth+"/"+$("table"+z).scrollWidth); 727 728 // wIw bSw tSw 729 // 430 / 860 / 430 730 // 429 / 430 / 430 731 // 366 / 430 / 430 732 733 // 672 / 1344 / 672 734 // 672 / 1329 / 1329 735 736 // Chrome: needs scrollbar 737 // wiW bsW tsW bcW tcW boW toW 738 // 100 200 100 84 100 84 100 739 // 100 85 85 69 85 79 85 740 741 // Chrome: does not need scrollbar 742 // 100 200 100 84 100 84 100 743 // 100 100 100 84 100 84 100 744 745 // Firefox: does not need scrollbar 746 // 100 84 100 84 100 84 100 747 // 100 84 100 84 100 84 100 748 749 // Firefox: does need scrollbar 750 // 100 84 100 84 100 84 100 751 // 100 69 85 69 85 69 85 752 753 // opera no scrollbar: 754 // 100 84 100 84 100 84 100 755 // 100 84 100 84 100 84 100 734 756 735 757 var max = $("body").getAttribute("data-max")=="yes"; 736 758 737 738 759 var ih = max ? W : H - h + parseInt(img.style.height, 10); 739 760 740 img.style.width = W +"px"; 741 img.style.height= ih+"px"; 742 743 canv.width = W; 744 canv.height = ih; 761 // This might create the scroll bar 762 img.style.height = ih+"px"; 763 canv.height = ih; 764 765 // now we can evaluate the correct view-port 766 // (-2 is the border size of the parent element 'container') 767 //var sW = (fixedw ? fixedw : $("table"+z).scrollWidth)-2; 768 var sW = fixedw ? fixedw : canv.parentNode.clientWidth; 769 770 img.style.width = sW+"px"; 771 canv.width = sW; 745 772 746 773 // ------ debug ----- … … 752 779 $('debug'+z).innerHTML += "|I="+img.style.height+"+"+H+"-"+h; 753 780 } 754 755 if ($("table"+z).offsetHeight == H || cnt==2)756 return;757 758 resizeimpl(z, ++cnt);759 }760 761 function doresize(z)762 {763 resizeimpl(z, 0);764 781 } 765 782 … … 798 815 $("table"+newz).style.left = (-W-1)+"px"; 799 816 800 //window.clearTimeout(timeoutText);801 //window.clearTimeout(timeoutGraphics);802 803 817 $("body").setAttribute("data-visible", newz); 818 819 // This is needed on my mobile to ensure that te browser 820 // doesn't try to zoom during shifting 821 // $("table"+newz).style.position="fixed"; 822 // $("table"+oldz).style.position="fixed"; 823 804 824 intervalSlide = setInterval(function(){doShift(oldz,newz)}, 75); 805 825 } … … 814 834 clearInterval(intervalSlide); 815 835 $("body").removeChild(t0); 836 837 // t1.style.position="absolute"; 838 839 // Now the scroll bar might have to appear or disappear 840 doresize(newz); 816 841 return; 817 842 } … … 981 1006 if (cols.length<=1) 982 1007 form = "—"; 1008 1009 form = form.replace(/<#(.*?)>/g, "<font color='$1'>"); 1010 form = form.replace(/<([\+-])>/g, "<font size='$11'>"); 1011 form = form.replace(/<\/([#\+-])>/g, "</font>"); 983 1012 984 1013 var newe = document.createElement("div"); … … 1258 1287 { 1259 1288 ctx.strokeStyle = "#"+color(16*i); 1260 ctx.strokeText((v0+diff*i/10).toPrecision(3)+unit, cw-5, 12 0-i*12);1289 ctx.strokeText((v0+diff*i/10).toPrecision(3)+unit, cw-5, 125-i*12); 1261 1290 } 1262 1291 }
Note:
See TracChangeset
for help on using the changeset viewer.