jquery.dgtable 0.6.2 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * jquery.dgtable 0.6.2
2
+ * jquery.dgtable 0.6.4
3
3
  * git://github.com/danielgindi/jquery.dgtable.git
4
4
  */
5
5
  import jQuery from 'jquery';
@@ -1789,9 +1789,9 @@ const hasInsertAdjacentElement = Element.prototype.insertAdjacentElement !== und
1789
1789
  function insertBefore(el, before, parent) {
1790
1790
  if (!before)
1791
1791
  parent.appendChild(el);else
1792
- if (hasInsertAdjacentElement === true)
1793
- before.insertAdjacentElement('beforebegin', el);else
1794
- parent.insertBefore(el, before);
1792
+ if (hasInsertAdjacentElement === false || el instanceof DocumentFragment)
1793
+ parent.insertBefore(el, before);else
1794
+ before.insertAdjacentElement('beforebegin', el);
1795
1795
  }
1796
1796
 
1797
1797
  /**
@@ -2344,7 +2344,7 @@ class VirtualListHelper {
2344
2344
  }
2345
2345
 
2346
2346
  // Find the element to insert before
2347
- let before = list.childNodes[0];
2347
+ let before = itemParent.childNodes[0];
2348
2348
 
2349
2349
  /** @type DocumentFragment|null */
2350
2350
  let fragment = null;
@@ -3576,7 +3576,7 @@ DGTable.prototype._setupHovers = function () {
3576
3576
  };
3577
3577
  };
3578
3578
 
3579
- DGTable.prototype._setupVirtualTable = function () {
3579
+ DGTable.prototype._setupVirtualTable = function () {var _p$filteredRows;
3580
3580
  const that = this,p = that.p,o = that.o;
3581
3581
 
3582
3582
  const tableClassName = o.tableClassName,
@@ -3601,7 +3601,7 @@ DGTable.prototype._setupVirtualTable = function () {
3601
3601
  list: p.table,
3602
3602
  itemsParent: p.tbody,
3603
3603
  autoVirtualWrapperWidth: false,
3604
- virtual: true,
3604
+ virtual: o.virtualTable,
3605
3605
  buffer: o.rowsBufferSize,
3606
3606
  estimatedItemHeight: o.estimatedRowHeight ? o.estimatedRowHeight : p.virtualRowHeight || 40,
3607
3607
  itemElementCreatorFn: () => {
@@ -3658,7 +3658,7 @@ DGTable.prototype._setupVirtualTable = function () {
3658
3658
  }
3659
3659
  });
3660
3660
 
3661
- p.virtualListHelper.setCount(p.rows.length);
3661
+ p.virtualListHelper.setCount(((_p$filteredRows = p.filteredRows) !== null && _p$filteredRows !== void 0 ? _p$filteredRows : p.rows).length);
3662
3662
 
3663
3663
  p.notifyRendererOfColumnsConfig();
3664
3664
  };
@@ -3947,7 +3947,7 @@ DGTable.prototype.render = function () {
3947
3947
  return this;
3948
3948
  }
3949
3949
 
3950
- if (p.tableSkeletonNeedsRendering === true) {
3950
+ if (p.tableSkeletonNeedsRendering === true) {var _p$filteredRows2;
3951
3951
  p.tableSkeletonNeedsRendering = false;
3952
3952
 
3953
3953
  if (o.width === DGTable.Width.AUTO) {
@@ -3963,7 +3963,7 @@ DGTable.prototype.render = function () {
3963
3963
  tableWidthChanged(true, false) // Take this chance to calculate required column widths
3964
3964
  ._renderSkeletonHeaderCells();
3965
3965
 
3966
- p.virtualListHelper.invalidate();
3966
+ p.virtualListHelper.setCount(((_p$filteredRows2 = p.filteredRows) !== null && _p$filteredRows2 !== void 0 ? _p$filteredRows2 : p.rows).length);
3967
3967
 
3968
3968
  this._updateLastCellWidthFromScrollbar(true);
3969
3969