diff options
author | arv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-06 00:31:26 +0000 |
---|---|---|
committer | arv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-06 00:31:26 +0000 |
commit | 43a3e74e0cb975dd629df2a14a21c393fd6ade65 (patch) | |
tree | c1690db5278c0a0f79cca9a2785012cc13e30abe /chrome/browser/resources/shared | |
parent | 910688e6d2f2d39a082e2afd999f42c0e435201e (diff) | |
download | chromium_src-43a3e74e0cb975dd629df2a14a21c393fd6ade65.zip chromium_src-43a3e74e0cb975dd629df2a14a21c393fd6ade65.tar.gz chromium_src-43a3e74e0cb975dd629df2a14a21c393fd6ade65.tar.bz2 |
DOMUI: Fix issue with the calculation of the index of a list item.
This fixes issues where list items cannot be selected when zoomed out a bit.
BUG=68670
TEST=Zoom out and select bookmarks
Review URL: http://codereview.chromium.org/5978008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70566 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources/shared')
-rw-r--r-- | chrome/browser/resources/shared/js/cr/ui/list.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/chrome/browser/resources/shared/js/cr/ui/list.js b/chrome/browser/resources/shared/js/cr/ui/list.js index 9a579d8..6fbe1cc 100644 --- a/chrome/browser/resources/shared/js/cr/ui/list.js +++ b/chrome/browser/resources/shared/js/cr/ui/list.js @@ -482,8 +482,9 @@ cr.define('cr.ui', function() { * @return {number} The index of the list item, or -1 if not found. */ getIndexOfListItem: function(item) { + var paddingTop = parseFloat(getComputedStyle(this).paddingTop); var cs = getComputedStyle(item); - var top = item.offsetTop - parseFloat(cs.marginTop); + var top = item.offsetTop - parseFloat(cs.marginTop) - paddingTop; var index = Math.floor(top / this.getItemHeight_()); var childIndex = index - this.firstIndex_ + 1; if (childIndex >= 0 && childIndex < this.children.length && |