Make scroll sync timeout optional
parent
9d8f352037
commit
68ee12f7e7
12
treegrid.js
12
treegrid.js
|
@ -100,7 +100,8 @@ function TreeGrid(options)
|
|||
this.wrapper = document.createElement('div');
|
||||
this.stickyRow = options.stickyHeaders||options.stickyRow;
|
||||
this.stickyColumn = options.stickyHeaders||options.stickyColumn;
|
||||
this.minItemHeight = 21;
|
||||
this.minItemHeight = options.minItemHeight||21;
|
||||
this.scrollTimeout = options.scrollTimeout||0;
|
||||
if (this.stickyRow || this.stickyColumn)
|
||||
{
|
||||
if (this.stickyRow && this.stickyColumn)
|
||||
|
@ -189,7 +190,6 @@ function TreeGrid(options)
|
|||
{
|
||||
this.wrapper.className += ' grid-no-sticky-col';
|
||||
}
|
||||
var syncTimer;
|
||||
addListener(this.tableWrapper, 'scroll', function()
|
||||
{
|
||||
if (self.scrolling != 2)
|
||||
|
@ -202,10 +202,10 @@ function TreeGrid(options)
|
|||
}
|
||||
else
|
||||
self.scrolling = 0;
|
||||
if (!syncTimer)
|
||||
{
|
||||
syncTimer = setTimeout(function() { self.syncView(); syncTimer = null; }, 100);
|
||||
}
|
||||
if (!self.scrollTimeout)
|
||||
self.syncView();
|
||||
else if (!self.scrollSyncTimer)
|
||||
self.scrollSyncTimer = setTimeout(function() { self.syncView(); self.scrollSyncTimer = null; }, self.scrollTimeout);
|
||||
});
|
||||
addListener(this.wrapper||this.table, 'mouseover', function(ev) { self.nodeOnHover(true, ev); });
|
||||
addListener(this.wrapper||this.table, 'mouseout', function(ev) { self.nodeOnHover(false, ev); });
|
||||
|
|
Loading…
Reference in New Issue