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

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: rebase 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
« no previous file with comments | « chrome/browser/resources/file_manager/js/file_manager.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..92afbd43393db193d0e6ec248c39abf171066d30 100644
--- a/chrome/browser/resources/file_manager/js/file_table.js
+++ b/chrome/browser/resources/file_manager/js/file_table.js
@@ -27,8 +27,8 @@ FileTableColumnModel.prototype.__proto__ =
cr.ui.table.TableColumnModel.prototype;
/**
- * Normalizes widths to make their sum 100%. Uses the proportional approach
- * with some additional constraints.
+ * Normalizes widths to make their sum 100% if possible. Uses the proportional
+ * approach with some additional constraints.
*
* @param {number} contentWidth Target width.
* @override
@@ -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);
}
};
« no previous file with comments | « chrome/browser/resources/file_manager/js/file_manager.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698