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

Unified Diff: Source/devtools/front_end/ui/DataGrid.js

Issue 334183003: DevTools: fixed UI glitches of inlined DataGrid. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed tests Created 6 years, 6 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 | « Source/devtools/front_end/dataGrid.css ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ui/DataGrid.js
diff --git a/Source/devtools/front_end/ui/DataGrid.js b/Source/devtools/front_end/ui/DataGrid.js
index dd84de8afc94a2a274233e49d4248fad1e88faf1..7edaf5c62d6bd8b19892450d30a84e1733af50b7 100644
--- a/Source/devtools/front_end/ui/DataGrid.js
+++ b/Source/devtools/front_end/ui/DataGrid.js
@@ -672,13 +672,16 @@ WebInspector.DataGrid.prototype = {
_applyColumnWeights: function()
{
+ var tableWidth = this.element.offsetWidth - this._cornerWidth;
+ if (tableWidth <= 0)
+ return;
+
var sumOfWeights = 0.0;
for (var i = 0; i < this._visibleColumnsArray.length; ++i)
sumOfWeights += this._visibleColumnsArray[i].weight;
var sum = 0;
var lastOffset = 0;
- var tableWidth = this.element.offsetWidth - this._cornerWidth;
for (var i = 0; i < this._visibleColumnsArray.length; ++i) {
sum += this._visibleColumnsArray[i].weight;
@@ -1128,6 +1131,8 @@ WebInspector.DataGrid.prototype = {
*/
columnOffset: function(columnId)
{
+ if (!this.element.offsetWidth)
+ return 0;
for (var i = 1; i < this._visibleColumnsArray.length; ++i) {
if (columnId === this._visibleColumnsArray[i].identifier)
return this._resizers[i - 1].__position;
« no previous file with comments | « Source/devtools/front_end/dataGrid.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698