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

Unified Diff: chrome/browser/resources/file_manager/js/file_table.js

Issue 15029002: CrOS Files.app: fix the redraw logic on resize. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add the check in FileTableColumnModel.normalizeWidth Created 7 years, 7 months 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
Index: chrome/browser/resources/file_manager/js/file_table.js
diff --git a/chrome/browser/resources/file_manager/js/file_table.js b/chrome/browser/resources/file_manager/js/file_table.js
index f8941a7f64fbac73b780f642c4badeed976a88d3..382583fab60c4c05a97bf8dcc00d417a7b290758 100644
--- a/chrome/browser/resources/file_manager/js/file_table.js
+++ b/chrome/browser/resources/file_manager/js/file_table.js
@@ -46,12 +46,13 @@ FileTableColumnModel.prototype.normalizeWidths = function(contentWidth) {
flexibleWidth += column.width;
}
- var factor = (contentWidth - fixedWidth) / flexibleWidth;
+ var factor = Math.max(0, contentWidth - fixedWidth) / flexibleWidth;
for (var index = 0; index < this.size; index++) {
var column = this.columns_[index];
if (column.id == 'selection')
continue;
- column.width = column.width * factor;
+ // Limits the minimum width to 1px to avoid flexibleWidth=0.
+ column.width = Math.max(1, column.width * factor);
}
};

Powered by Google App Engine
This is Rietveld 408576698