//>>built define(["dijit/registry","dojo/_base/declare","dojo/_base/lang","./util","dojo/_base/html"],function(k,l,m,n,g){var p=function(a){a&&dojo.forEach(k.toArray(),function(b){b.domNode&&g.isDescendant(b.domNode,a,!0)&&b.destroy()})},h=function(a,b){for(var c=[],d=0,e;e=a.childNodes[d];){d++;var f=g.byId(e);(f&&f.tagName?f.tagName.toLowerCase():"")==b&&c.push(e)}return c};return l("dojox.grid._Scroller",null,{constructor:function(a){this.setContentNodes(a);this.pageHeights=[];this.pageNodes=[];this.stack= []},rowCount:0,defaultRowHeight:32,keepRows:100,contentNode:null,scrollboxNode:null,defaultPageHeight:0,keepPages:10,pageCount:0,windowHeight:0,firstVisibleRow:0,lastVisibleRow:0,averageRowHeight:0,page:0,pageTop:0,init:function(a,b,c){switch(arguments.length){case 3:this.rowsPerPage=c;case 2:this.keepRows=b;case 1:this.rowCount=a}this.defaultPageHeight=(0=this.pageCount;a--)this.height-=this.getPageHeight(a),delete this.pageHeights[a];else this.pageCount>a&&(this.height+=this.defaultPageHeight*(this.pageCount-a-1)+this.calcLastPageHeight());this.resize()},pageExists:function(a){return!!this.getDefaultPageNode(a)},measurePage:function(a){return this.grid.rowHeight?((a+1)*this.rowsPerPage>this.rowCount?this.rowCount-a*this.rowsPerPage:this.rowsPerPage)*this.grid.rowHeight: (a=this.getDefaultPageNode(a))&&a.innerHTML?a.offsetHeight:void 0},positionPage:function(a,b){for(var c=0;cthis.pacifyTicks;this.setPacifying(!0);this.startPacify(); return a},endPacify:function(){this.setPacifying(!1)},resize:function(){this.scrollboxNode&&(this.windowHeight=this.scrollboxNode.clientHeight);for(var a=0;athis.rowCount||!0===f&&!b?c?(b=this.grid.viewsNode.style,b.height=parseInt(b.height)+e-d+"px",this.repositionPages(a)):this.grid.sizeChange():this.repositionPages(a)}return e}return 0},rowHeightChanged:function(a,b){this.updatePageHeight(Math.floor(a/this.rowsPerPage),!1,b)},invalidateNodes:function(){for(;this.stack.length;)this.destroyPage(this.popPage())},createPageNode:function(){var a=document.createElement("div");g.attr(a,"role","presentation"); a.style.position="absolute";a.style[this.grid.isLeftToRight()?"left":"right"]="0";return a},getPageHeight:function(a){a=this.pageHeights[a];return void 0!==a?a:this.defaultPageHeight},pushPage:function(a){return this.stack.push(a)},popPage:function(){return this.stack.shift()},findPage:function(a){for(var b=0,c=0,d=0;b=a);b++,c+=d);this.page=b;this.pageTop=c},buildPage:function(a,b,c){this.preparePage(a,b);this.positionPage(a,c);this.installPage(a);this.renderPage(a); this.pushPage(a)},needPage:function(a,b){var c=this.getPageHeight(a);this.pageExists(a)?this.positionPage(a,b):(this.buildPage(a,!this.grid._autoHeight&&this.keepPages&&this.stack.length>=this.keepPages,b),c=this.updatePageHeight(a,!0));return c},onscroll:function(){this.scroll(this.scrollboxNode.scrollTop)},scroll:function(a){this.grid.scrollTop=a;if(this.colCount){this.startPacify();this.findPage(a);for(var b=this.height,c=this.getScrollBottom(a),d=this.page,e=this.pageTop;d c||ec;d--,e--)b-=a[d].offsetHeight;return e+1},findTopRow:function(a){for(var b=this.getDefaultNodes(),b=h(b[this.page],"div"),c=0,d=b.length,e=this.pageTop,f;c=a)return this.offset=f-(e-a),c+this.page*this.rowsPerPage;return-1},findScrollTop:function(a){var b=Math.floor(a/this.rowsPerPage),c=0,d;for(d=0;d