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.wrapper = document.createElement('div');
|
||||||
this.stickyRow = options.stickyHeaders||options.stickyRow;
|
this.stickyRow = options.stickyHeaders||options.stickyRow;
|
||||||
this.stickyColumn = options.stickyHeaders||options.stickyColumn;
|
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)
|
||||||
{
|
{
|
||||||
if (this.stickyRow && this.stickyColumn)
|
if (this.stickyRow && this.stickyColumn)
|
||||||
|
@ -189,7 +190,6 @@ function TreeGrid(options)
|
||||||
{
|
{
|
||||||
this.wrapper.className += ' grid-no-sticky-col';
|
this.wrapper.className += ' grid-no-sticky-col';
|
||||||
}
|
}
|
||||||
var syncTimer;
|
|
||||||
addListener(this.tableWrapper, 'scroll', function()
|
addListener(this.tableWrapper, 'scroll', function()
|
||||||
{
|
{
|
||||||
if (self.scrolling != 2)
|
if (self.scrolling != 2)
|
||||||
|
@ -202,10 +202,10 @@ function TreeGrid(options)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
self.scrolling = 0;
|
self.scrolling = 0;
|
||||||
if (!syncTimer)
|
if (!self.scrollTimeout)
|
||||||
{
|
self.syncView();
|
||||||
syncTimer = setTimeout(function() { self.syncView(); syncTimer = null; }, 100);
|
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, 'mouseover', function(ev) { self.nodeOnHover(true, ev); });
|
||||||
addListener(this.wrapper||this.table, 'mouseout', function(ev) { self.nodeOnHover(false, ev); });
|
addListener(this.wrapper||this.table, 'mouseout', function(ev) { self.nodeOnHover(false, ev); });
|
||||||
|
|
Loading…
Reference in New Issue