Ext.namespace("THSite.controls.livegrid");THSite.controls.livegrid.GridView=Ext.extend(Ext.ux.grid.livegrid.GridView,{constructor:function(a){this.cursorBuffer=[];this.WAIT_BEFORE_REFRESH=700;THSite.controls.livegrid.GridView.superclass.constructor.call(this,a)},onLiveScroll:function(){var b=this.liveScroller.dom.scrollTop;var c=Math.floor((b)/this.rowHeight);this.rowIndex=c;if(c==this.lastRowIndex){return}var a=(function(){this.updateLiveRows(this.cursorBuffer[this.cursorBuffer.length-1]);this.lastScrollPos=this.liveScroller.dom.scrollTop;this.cursorBuffer=[];this.adjustScroller()}).createDelegate(this);if(this.cursorBuffer.length==0){window.setTimeout(a,this.WAIT_BEFORE_REFRESH)}this.cursorBuffer.push(c)},adjustScroller:function(){var a=this.rowHeight;var b=0;Ext.each(this.getRows(),function(c){b+=c.offsetHeight-a});this.adjustBufferInset(b)},adjustBufferInset:function(l){var m=this.liveScroller.dom;var f=this.grid,b=f.store;var k=f.getGridEl();var p=k.getSize().width;var a=(b.totalLength==this.visibleRows-this.rowClipped)?0:Math.max(0,b.totalLength-(this.visibleRows-this.rowClipped));if(a==0){this.scroller.setWidth(p);m.style.display="none";return}else{this.scroller.setWidth(p-this.getScrollOffset());m.style.display=""}var q=this.cm.getTotalWidth()+this.getScrollOffset()>p;var o=m.parentNode.offsetHeight+((b.totalLength>0&&q)?-this.horizontalScrollOffset:0)-this.hdHeight;m.style.height=Math.max(o,this.horizontalScrollOffset*2)+"px";if(this.rowHeight==-1){return}var e=(a==0?0:o+(a*this.rowHeight));var n=e;var j=this.liveScrollerInsets.length;if(e==0){e=0}else{e=Math.round(e/j)}for(var d=0;d<j;d++){if(d==j-1&&e!=0){e-=(e*3)-n}this.liveScrollerInsets[d].style.height=e+"px"}},onBulkRemove:function(a,b){THSite.controls.livegrid.GridView.superclass.onBulkRemove.apply(this,arguments);if(this.ds.totalLength==0){this.applyEmptyText()}},renderRows:function(b,a){b=b||0;if(a===undefined){a=b+this.visibleRows-1}return THSite.controls.livegrid.GridView.superclass.renderRows.call(this,b,a)},getScrollOffset:function(){return Ext.num(this.scrollOffset,Ext.getScrollBarWidth())}});