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

Unified Diff: ui/webui/resources/js/cr/ui/table.js

Issue 2745593003: Use actual client width of list excluding scroll bar for adjusting column widths.
Patch Set: rebase Created 3 years, 9 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 | « ui/webui/resources/js/cr/ui/list.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/js/cr/ui/table.js
diff --git a/ui/webui/resources/js/cr/ui/table.js b/ui/webui/resources/js/cr/ui/table.js
index 9e28e4c752e2361270ae2a7e037db70ffea79ea0..b5f0d45df7327b2dfe914d09d9b6b0043d45fb54 100644
--- a/ui/webui/resources/js/cr/ui/table.js
+++ b/ui/webui/resources/js/cr/ui/table.js
@@ -186,6 +186,13 @@ cr.define('cr.ui', function() {
this.addEventListener('focus', this.handleElementFocus_, true);
this.addEventListener('blur', this.handleElementBlur_, true);
+ this.list_.setClientWidthChangedCallback(
+ this.onListClientWidthChanged.bind(this));
+ },
+
+ onListClientWidthChanged: function(newClientWidth) {
+ this.normalizeColumns();
+ this.list_.redraw();
},
/**
@@ -361,7 +368,9 @@ cr.define('cr.ui', function() {
},
normalizeColumns: function() {
- this.columnModel.normalizeWidths(this.clientWidth);
+ // list_.clientWidth must be used here instead of this.clientWidth,
+ // because it can be narrower by the thickness of the vertical scrollbar.
+ this.columnModel.normalizeWidths(this.list_.clientWidth);
}
};
« no previous file with comments | « ui/webui/resources/js/cr/ui/list.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698