Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1817)

Unified Diff: chrome/browser/resources/shared/js/cr/ui/list.js

Issue 11280253: Fixing column widths in tables. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review fixes. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/shared/css/table.css ('k') | chrome/browser/resources/shared/js/cr/ui/table.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/shared/js/cr/ui/list.js
diff --git a/chrome/browser/resources/shared/js/cr/ui/list.js b/chrome/browser/resources/shared/js/cr/ui/list.js
index 38b0451032cfaa5e7c58ab218482e8d32d17432a..34257d9e780b5c7160e28c363fa7cedd5e077737 100644
--- a/chrome/browser/resources/shared/js/cr/ui/list.js
+++ b/chrome/browser/resources/shared/js/cr/ui/list.js
@@ -346,12 +346,6 @@ cr.define('cr.ui', function() {
* @private
*/
measureItemHeight_: function(item) {
- var height = item.style.height;
- // Use the fixed height if set it on CSS, to save a time of layout
- // calculation.
- if (height && height.substr(-2) == 'px')
- return parseInt(height.substr(0, height.length - 2));
-
return this.measureItem(item).height;
},
@@ -376,9 +370,11 @@ cr.define('cr.ui', function() {
return this.cachedItemHeights_[index];
var item = this.getListItemByIndex(index);
- if (item)
- return this.measureItemHeight_(item);
-
+ if (item) {
+ var h = this.measureItemHeight_(item);
+ this.cachedItemHeights_[index] = h;
+ return h;
+ }
return this.getDefaultItemHeight_();
},
@@ -688,6 +684,7 @@ cr.define('cr.ui', function() {
var itemHeight = this.getDefaultItemHeight_();
return index * itemHeight;
} else {
+ this.ensureAllItemSizesInCache();
var top = 0;
for (var i = 0; i < index; i++) {
top += this.getItemHeightByIndex_(i);
@@ -1053,7 +1050,6 @@ cr.define('cr.ui', function() {
/**
* Returns the height of after filler in the list.
* @param {number} lastIndex The index of item past the last in viewport.
- * @param {number} itemHeight The height of the item.
* @return {number} The height of after filler.
*/
getAfterFillerHeight: function(lastIndex) {
@@ -1080,7 +1076,7 @@ cr.define('cr.ui', function() {
this.cachedItems_ = {};
this.firstIndex_ = 0;
this.lastIndex_ = 0;
- this.remainingSpace_ = true;
+ this.remainingSpace_ = this.clientHeight != 0;
this.mergeItems(0, 0, {}, {});
return;
}
« no previous file with comments | « chrome/browser/resources/shared/css/table.css ('k') | chrome/browser/resources/shared/js/cr/ui/table.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698