Skip to content

Commit 51ec54d

Browse files
committed
Version bump
1 parent 3ec05a4 commit 51ec54d

File tree

4 files changed

+92
-84
lines changed

4 files changed

+92
-84
lines changed

dist/vue-virtual-scroller.esm.js

Lines changed: 45 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ var uid = 0;
598598
var RecycleList = { render: function render() {
599599
var _vm = this;var _h = _vm.$createElement;var _c = _vm._self._c || _h;return _c('div', { directives: [{ name: "observe-visibility", rawName: "v-observe-visibility", value: _vm.handleVisibilityChange, expression: "handleVisibilityChange" }], staticClass: "recycle-list", class: _vm.cssClass, on: { "&scroll": function scroll($event) {
600600
_vm.handleScroll($event);
601-
} } }, [_c('div', { staticClass: "item-wrapper", style: { height: _vm.totalHeight + 'px' } }, _vm._l(_vm.pool, function (view) {
601+
} } }, [_c('div', { ref: "wrapper", staticClass: "item-wrapper", style: { height: _vm.totalHeight + 'px' } }, _vm._l(_vm.pool, function (view) {
602602
return _c('div', { key: view.nr.id, staticClass: "item-view", style: { transform: 'translateY(' + view.top + 'px)' } }, [_vm._t("default", null, { item: view.item, active: view.nr.used })], 2);
603603
})), _vm._v(" "), _vm._t("after-container"), _vm._v(" "), _c('resize-observer', { on: { "notify": _vm.handleResize } })], 2);
604604
}, staticRenderFns: [], _scopeId: 'data-v-2277f571',
@@ -767,50 +767,54 @@ var RecycleList = { render: function render() {
767767
endIndex = void 0;
768768
var totalHeight = void 0;
769769

770-
// Variable height mode
771-
if (itemHeight === null) {
772-
var h = void 0;
773-
var a = 0;
774-
var b = count - 1;
775-
var i = ~~(count / 2);
776-
var oldI = void 0;
777-
778-
// Searching for startIndex
779-
do {
780-
oldI = i;
781-
h = heights[i].accumulator;
782-
if (h < scroll.top) {
783-
a = i;
784-
} else if (i < count - 1 && heights[i + 1].accumulator > scroll.top) {
785-
b = i;
770+
if (!count) {
771+
startIndex = endIndex = totalHeight = 0;
772+
} else {
773+
// Variable height mode
774+
if (itemHeight === null) {
775+
var h = void 0;
776+
var a = 0;
777+
var b = count - 1;
778+
var i = ~~(count / 2);
779+
var oldI = void 0;
780+
781+
// Searching for startIndex
782+
do {
783+
oldI = i;
784+
h = heights[i].accumulator;
785+
if (h < scroll.top) {
786+
a = i;
787+
} else if (i < count - 1 && heights[i + 1].accumulator > scroll.top) {
788+
b = i;
789+
}
790+
i = ~~((a + b) / 2);
791+
} while (i !== oldI);
792+
i < 0 && (i = 0);
793+
startIndex = i;
794+
795+
// For container style
796+
totalHeight = heights[count - 1].accumulator;
797+
798+
// Searching for endIndex
799+
for (endIndex = i; endIndex < count && heights[endIndex].accumulator < scroll.bottom; endIndex++) {}
800+
if (endIndex === -1) {
801+
endIndex = items.length - 1;
802+
} else {
803+
endIndex++;
804+
// Bounds
805+
endIndex > count && (endIndex = count);
786806
}
787-
i = ~~((a + b) / 2);
788-
} while (i !== oldI);
789-
i < 0 && (i = 0);
790-
startIndex = i;
791-
792-
// For container style
793-
totalHeight = heights[count - 1].accumulator;
794-
795-
// Searching for endIndex
796-
for (endIndex = i; endIndex < count && heights[endIndex].accumulator < scroll.bottom; endIndex++) {}
797-
if (endIndex === -1) {
798-
endIndex = items.length - 1;
799807
} else {
800-
endIndex++;
808+
// Fixed height mode
809+
startIndex = ~~(scroll.top / itemHeight);
810+
endIndex = Math.ceil(scroll.bottom / itemHeight);
811+
801812
// Bounds
813+
startIndex < 0 && (startIndex = 0);
802814
endIndex > count && (endIndex = count);
803-
}
804-
} else {
805-
// Fixed height mode
806-
startIndex = ~~(scroll.top / itemHeight);
807-
endIndex = Math.ceil(scroll.bottom / itemHeight);
808815

809-
// Bounds
810-
startIndex < 0 && (startIndex = 0);
811-
endIndex > count && (endIndex = count);
812-
813-
totalHeight = count * itemHeight;
816+
totalHeight = count * itemHeight;
817+
}
814818
}
815819

816820
this.totalHeight = totalHeight;
@@ -927,7 +931,7 @@ function registerComponents(Vue, prefix) {
927931

928932
var plugin$4 = {
929933
// eslint-disable-next-line no-undef
930-
version: "0.11.3",
934+
version: "0.11.4",
931935
install: function install(Vue, options) {
932936
var finalOptions = Object.assign({}, {
933937
installComponents: true,

0 commit comments

Comments
 (0)