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

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

Issue 28923003: DevTools: console.table attached inside a collapsed console group is not resizeable. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: addressed Created 7 years, 2 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/ConsoleView.js ('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/DataGrid.js
diff --git a/Source/devtools/front_end/DataGrid.js b/Source/devtools/front_end/DataGrid.js
index bd4036717501c6e08937ed64c7869cd3b857944b..420d2414c14807b578fa1a589fee6747475a8ba9 100644
--- a/Source/devtools/front_end/DataGrid.js
+++ b/Source/devtools/front_end/DataGrid.js
@@ -473,9 +473,10 @@ WebInspector.DataGrid.prototype = {
},
/**
- * @param {Array.<number>} widths
+ * @param {!Array.<number>} widths
* @param {number} minPercent
* @param {number=} maxPercent
+ * @return {!Array.<number>}
*/
_autoSizeWidths: function(widths, minPercent, maxPercent)
{
@@ -592,7 +593,7 @@ WebInspector.DataGrid.prototype = {
// for their widths.
for (var i = 0; i < numColumns; i++) {
var columnWidth = this.headerTableBody.rows[0].cells[i].offsetWidth;
- var percentWidth = ((columnWidth / tableWidth) * 100) + "%";
+ var percentWidth = (100 * columnWidth / tableWidth) + "%";
this._headerTableColumnGroup.children[i].style.width = percentWidth;
this._dataTableColumnGroup.children[i].style.width = percentWidth;
}
@@ -650,11 +651,10 @@ WebInspector.DataGrid.prototype = {
if (this.isColumnVisible(column))
sumOfWeights += column.weight;
}
- var factor = 100 / sumOfWeights;
for (var i = 0; i < this._columnsArray.length; ++i) {
var column = this._columnsArray[i];
- var width = this.isColumnVisible(column) ? ((factor * column.weight) + "%"): "0%";
+ var width = this.isColumnVisible(column) ? (100 * column.weight / sumOfWeights) + "%" : "0%";
this._headerTableColumnGroup.children[i].style.width = width;
this._dataTableColumnGroup.children[i].style.width = width;
}
@@ -1036,7 +1036,7 @@ WebInspector.DataGrid.prototype = {
_startResizerDragging: function(event)
{
this._currentResizer = event.target;
- return !!this._currentResizer.rightNeighboringColumnIndex
+ return !!this._currentResizer.rightNeighboringColumnIndex;
},
_resizerDragging: function(event)
@@ -1079,11 +1079,11 @@ WebInspector.DataGrid.prototype = {
resizer.style.left = (dragPoint - this.CenterResizerOverBorderAdjustment) + "px";
- var percentLeftColumn = (((dragPoint - leftEdgeOfPreviousColumn) / tableWidth) * 100) + "%";
+ var percentLeftColumn = (100 * (dragPoint - leftEdgeOfPreviousColumn) / tableWidth) + "%";
pfeldman 2013/10/24 14:40:42 I don't think floating point precision matters sin
this._headerTableColumnGroup.children[leftCellIndex].style.width = percentLeftColumn;
this._dataTableColumnGroup.children[leftCellIndex].style.width = percentLeftColumn;
- var percentRightColumn = (((rightEdgeOfNextColumn - dragPoint) / tableWidth) * 100) + "%";
+ var percentRightColumn = (100 * (rightEdgeOfNextColumn - dragPoint) / tableWidth) + "%";
this._headerTableColumnGroup.children[rightCellIndex].style.width = percentRightColumn;
this._dataTableColumnGroup.children[rightCellIndex].style.width = percentRightColumn;
« no previous file with comments | « Source/devtools/front_end/ConsoleView.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698