Skip to content

Commit

Permalink
fix bug with multiple element in row
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitagromov committed Aug 6, 2015
1 parent 89bc6fc commit 6080a88
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 8 deletions.
5 changes: 4 additions & 1 deletion Gruntfile.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,15 @@ module.exports = (grunt) ->

grunt.registerTask 'build', [
'jshint:test'
'karma:travis'
# 'karma:travis'
'coffee:build'
'concat'
'jshint:dist'
'uglify:common']

grunt.registerTask 'travis', [
'karma:travis'
]
grunt.registerTask 'compile', [
'coffee:build'
]
2 changes: 1 addition & 1 deletion dist/ui-scroll-jqlite.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* angular-ui-scroll
* https://github.com/angular-ui/ui-scroll.git
* Version: 1.3.1 -- 2015-08-05T13:39:04.079Z
* Version: 1.3.1 -- 2015-08-06T14:43:32.930Z
* License: MIT
*/

Expand Down
2 changes: 1 addition & 1 deletion dist/ui-scroll-jqlite.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions dist/ui-scroll.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* angular-ui-scroll
* https://github.com/angular-ui/ui-scroll.git
* Version: 1.3.1 -- 2015-08-05T13:39:04.079Z
* Version: 1.3.1 -- 2015-08-06T14:43:32.930Z
* License: MIT
*/

Expand Down Expand Up @@ -433,6 +433,7 @@ angular.module('ui.scroll', []).directive('uiScrollViewport', function() {
});
};
fetch = function(rid) {
var customBufferSize, q, rowTop;
if (pending[0]) {
if (buffer.length && !shouldLoadBottom()) {
return finalize(rid);
Expand Down Expand Up @@ -461,7 +462,16 @@ angular.module('ui.scroll', []).directive('uiScrollViewport', function() {
if (buffer.length && !shouldLoadTop()) {
return finalize(rid);
} else {
return datasource.get(first - bufferSize, bufferSize, function(result) {
rowTop = buffer[0].element.offset().top;
q = 0;
while (q < buffer.length) {
if (rowTop !== buffer[q].element.offset().top) {
break;
}
q++;
}
customBufferSize = bufferSize % q !== 0 ? bufferSize + q - (bufferSize % q) : bufferSize;
return datasource.get(first - customBufferSize, customBufferSize, function(result) {
var i, j, ref;
if ((rid && rid !== ridActual) || $scope.$$destroyed) {
return;
Expand Down
Loading

0 comments on commit 6080a88

Please sign in to comment.