vscroll 1.5.0 → 1.5.1

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,6 +1,6 @@
1
1
  /**
2
2
  * vscroll (https://github.com/dhilt/vscroll) FESM2015
3
- * Version: 1.5.0 (2022-02-02T15:07:21.893Z)
3
+ * Version: 1.5.1 (2022-09-02T19:54:22.128Z)
4
4
  * Author: Denis Hilt
5
5
  * License: MIT
6
6
  */
@@ -328,7 +328,7 @@ const reactiveConfigStorage = new Map();
328
328
 
329
329
  var core = {
330
330
  name: 'vscroll',
331
- version: '1.5.0'
331
+ version: '1.5.1'
332
332
  };
333
333
 
334
334
  let instanceCount$1 = 0;
@@ -2888,12 +2888,13 @@ class Routines {
2888
2888
  };
2889
2889
  // provide custom overrides for IRoutines methods
2890
2890
  if (CustomRoutines) {
2891
+ const self = this;
2891
2892
  const routines = new CustomRoutines(element, this.settings);
2892
2893
  Object.getOwnPropertyNames(Object.getPrototypeOf(routines))
2893
2894
  .filter(method => method !== 'constructor' &&
2894
2895
  typeof routines[method] === 'function' &&
2895
- typeof this[method] === 'function')
2896
- .forEach(method => this[method] = (...args) => routines[method].apply(this, args));
2896
+ typeof self[method] === 'function')
2897
+ .forEach(method => self[method] = (...args) => routines[method].apply(this, args));
2897
2898
  }
2898
2899
  // initialization
2899
2900
  this.viewport = this.getViewportElement();
@@ -3924,15 +3925,11 @@ class Buffer {
3924
3925
  }
3925
3926
  getFirstVisibleItem() {
3926
3927
  const index = this.getFirstVisibleItemIndex();
3927
- if (index >= 0) {
3928
- return this.items[index];
3929
- }
3928
+ return index >= 0 ? this.items[index] : void 0;
3930
3929
  }
3931
3930
  getLastVisibleItem() {
3932
3931
  const index = this.getLastVisibleItemIndex();
3933
- if (index >= 0) {
3934
- return this.items[index];
3935
- }
3932
+ return index >= 0 ? this.items[index] : void 0;
3936
3933
  }
3937
3934
  getEdgeVisibleItem(direction, opposite) {
3938
3935
  return direction === (!opposite ? Direction.forward : Direction.backward) ?