-
Notifications
You must be signed in to change notification settings - Fork 5
/
fxHeader_0.6.min.js
executable file
·8 lines (8 loc) · 3.68 KB
/
fxHeader_0.6.min.js
1
2
3
4
5
6
7
8
(function(){var m=!1,g=[];this.ge$=function(c){return document.getElementById(c)};this.scrollHeader=function(c){if(!m){c=c?c:window.event;c=c.target?c.target:c.srcElement;3==c.nodeType&&(c=c.parentNode);var a=c.id.replace(":scroller",""),d=ge$(a+":scroller:fx"),c=ge$(a+":scroller");d.style.left=0-c.scrollLeft+"px";if(a=ge$(a+"_CFB"))d=parseInt(a.getAttribute("dmt")),a.style.marginTop=0-(c.scrollTop+d)+"px"}};this.fxheader=function(){if(!m){m=!0;for(var c=!1,a=0;a<g.length;a++){var d=ge$(g[a].tid),
i=g[a].swidth+"";if(0<=i.indexOf("%")){var c=!0,e=ge$(g[a].tid+":scroller:fx");e.style.width="0px";i=parseInt(i);i=(document.body.offsetWidth?document.body.offsetWidth:window.innerWidth)*i/100;e.style.width="9999px"}d.style.width=parseInt(i-18)+"px";e=ge$(g[a].tid+":scroller:fx");e.style.marginLeft="0px";e.style.display="";var f=e.childNodes,b;for(b=0;b<f.length;b++)e.removeChild(f[b]);var h=d.cloneNode(!1);h.id=g[a].tid+"__cN";h.style.width=d.offsetWidth+"px";h.style.marginTop="0px";h.style.marginLeft=
"0px";f=document.createElement("thead");f.style.padding="0px";f.style.margin="0px";for(b=0;b<g[a].noOfRows;b++){var j=d.rows[b].cloneNode(!0);f.appendChild(j)}h.appendChild(f);e.appendChild(h);var l;0<g[a].noOfCols&&(l=h.cloneNode(!0),l.id=g[a].tid+"_CFH");for(b=f=0;b<g[a].noOfRows;b++){var j=h.rows[b].cells,n,o=d.rows[b].cells,k;if(l){n=l.rows[b].cells;for(k=0;k<j.length;k++)j[k].style.width=n[k].style.width=o[k].offsetWidth-3+"px"}else for(k=0;k<j.length;k++)j[k].style.width=o[k].offsetWidth-3+
"px";f+=d.rows[b].offsetHeight}d.style.marginTop="-"+f+"px";h=g[a].sheight;d.offsetHeight<h&&(h=d.offsetHeight+18);j=0;if(0<g[a].noOfCols){for(b=0;b<g[a].noOfCols;b++)j+=d.rows[0].cells[b].offsetWidth;d.style.marginLeft="-"+j+"px";d.style.display="block";e.style.marginLeft="-"+j+"px";ge$(g[a].tid+":scroller:fxcol").style.width=j+"px";b=ge$(g[a].tid+":scroller:fxCH");e=ge$(g[a].tid+":scroller:fxCB");b.innerHTML="";e.innerHTML="";b.appendChild(l);b.style.height=f+"px";e.style.height=h-f+"px";d=d.cloneNode(!0);
d.id=g[a].tid+"_CFB";d.style.marginLeft="0px";d.setAttribute("dmt",f);e.appendChild(d)}i=parseInt(i)-j+"px";ge$(g[a].tid+":scroller").style.height=h-f+"px";ge$(g[a].tid+":scroller").style.width=i;ge$(g[a].tid+":scroller:fx:OuterDiv").style.height=f+"px";ge$(g[a].tid+":scroller:fx:OuterDiv").style.width=i}c&&(window.onresize=fxheader);m=!1}};this.fxheaderInit=function(c,a,d,i){var e={},f=ge$(c);e.tid=c;e.sheight=a;e.swidth=f.width;if(!e.swidth||0==e.swidth.length)if(!e.swidth||0==e.swidth.length)e.swidth=
f.style.width,-1==e.swidth.indexOf("%")&&(e.swidth=parseInt(e.swidth));e.noOfRows=d;e.noOfCols=i;if(!ge$(c+":scroller")){var b=ge$(c),a=b.parentNode,d=b.nextSibling,f=document.createElement("div");f.id=c+":scroller";f.style.cssText="height:auto;overflow-x:auto;overflow-y:auto;width:auto;";f.onscroll=scrollHeader;f.appendChild(b);b=document.createElement("div");b.id=c+":scroller:fx:OuterDiv";b.style.cssText="position:relative;width:auto;overflow:hidden;overflow-x:hidden;padding:0px;margin:0px;";b.innerHTML=
'<div id="'+c+':scroller:fx" style="text-align:left;position:relative;width:9999px;padding:0px;margin-left:0px;"><font size="3" color="red">Please wait while loading the table..</font></div>';var h=null;0<i&&(h=document.createElement("div"),h.id=c+":scroller:fxcol",h.style.cssText="width:0px;height:auto;display:block;float:left;overflow:hidden;",h.innerHTML="<div id='"+c+":scroller:fxCH' style='width:100%;overflow:hidden;'> </div><div id='"+c+":scroller:fxCB' style='width:100%;overflow:hidden;'> </div>");
d?(h&&a.insertBefore(h,d),a.insertBefore(b,d),a.insertBefore(f,d)):(h&&a.appendChild(h),a.appendChild(b),a.appendChild(f));$("#user-grades:scroller:fxcol > input").tabIndex=-1}g[g.length]=e}})();