Fix Bug 54459

This commit is contained in:
Julia Radzhabova 2021-12-09 16:31:25 +03:00
parent 338b4aed62
commit 2f5db86f23

View file

@ -808,14 +808,14 @@ define([
}; };
var el = $(this.dataViewItems[0].el), var el = $(this.dataViewItems[0].el),
itemW = el.outerWidth() + parseInt(el.css('margin-left')) + parseInt(el.css('margin-right')), itemW = el.outerWidth() + parseFloat(el.css('margin-left')) + parseFloat(el.css('margin-right')),
offsetLeft = this.$el.offset().left, offsetLeft = this.$el.offset().left,
offsetTop = el.offset().top, offsetTop = el.offset().top,
prevtop = -1, topIdx = 0, leftIdx = 0; prevtop = -1, topIdx = 0, leftIdx = 0;
for (var i=0; i<this.dataViewItems.length; i++) { for (var i=0; i<this.dataViewItems.length; i++) {
var top = $(this.dataViewItems[i].el).offset().top - offsetTop; var top = $(this.dataViewItems[i].el).offset().top - offsetTop;
leftIdx = Math.floor(($(this.dataViewItems[i].el).offset().left - offsetLeft)/itemW); leftIdx = Math.floor(($(this.dataViewItems[i].el).offset().left - offsetLeft)/itemW + 0.01);
if (top>prevtop) { if (top>prevtop) {
prevtop = top; prevtop = top;
this._layoutParams.itemsIndexes.push([]); this._layoutParams.itemsIndexes.push([]);
@ -1266,7 +1266,7 @@ define([
}; };
var el = this.dataViewItems[0].el, var el = this.dataViewItems[0].el,
itemW = el.outerWidth() + parseInt(el.css('margin-left')) + parseInt(el.css('margin-right')), itemW = el.outerWidth() + parseFloat(el.css('margin-left')) + parseFloat(el.css('margin-right')),
offsetLeft = this.$el.offset().left, offsetLeft = this.$el.offset().left,
offsetTop = el.offset().top, offsetTop = el.offset().top,
prevtop = -1, topIdx = 0, leftIdx = 0; prevtop = -1, topIdx = 0, leftIdx = 0;