Commit ddaee815 authored by ivankr@chromium.org's avatar ivankr@chromium.org

WebUI: fix error in Grid.getItemsInViewPort preventing correct layout.


BUG=chromium-os:24015
TEST=Manual: see bug description; all grids in WebUI should be layout properly.


Review URL: http://codereview.chromium.org/8923001

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114279 0039d316-1c4b-4281-b951-d872f2087c98
parent 16934f32
...@@ -168,7 +168,11 @@ cr.define('cr.ui', function() { ...@@ -168,7 +168,11 @@ cr.define('cr.ui', function() {
this.countItemsInRange_(firstIndex, scrollTop + clientHeight)); this.countItemsInRange_(firstIndex, scrollTop + clientHeight));
count = columns * Math.ceil(count / columns); count = columns * Math.ceil(count / columns);
count = Math.min(count, this.dataModel.length - firstIndex); count = Math.min(count, this.dataModel.length - firstIndex);
return count; return {
first: firstIndex,
length: count,
last: firstIndex + count - 1
};
}, },
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment