Changeset 86855 in webkit
- Timestamp:
- May 19, 2011 11:14:58 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r86854 r86855 1 2011-05-19 Tonis Tiigi <tonistiigi@gmail.com> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: Resizing columns in the network panel is weird 6 https://bugs.webkit.org/show_bug.cgi?id=55238 7 8 Makes network panel column resizing more usable by adding "first only" and "last only" 9 resizing methods to WebInspector.DataGrid. Current behavior is named "nearest" and 10 remains default. Network panels datagrid is set to use method "last". 11 12 * inspector/front-end/DataGrid.js: 13 (WebInspector.DataGrid.prototype.get resizeMethod): 14 (WebInspector.DataGrid.prototype.set resizeMethod): 15 (WebInspector.DataGrid.prototype._resizerDragging): 16 * inspector/front-end/NetworkPanel.js: 17 (WebInspector.NetworkPanel.prototype._createTable): 18 1 19 2011-05-19 Ryosuke Niwa <rniwa@webkit.org> 2 20 -
trunk/Source/WebCore/inspector/front-end/DataGrid.js
r83031 r86855 923 923 }, 924 924 925 get resizeMethod() 926 { 927 if (typeof this._resizeMethod === "undefined") 928 return WebInspector.DataGrid.ResizeMethod.Nearest; 929 return this._resizeMethod; 930 }, 931 932 set resizeMethod(method) 933 { 934 this._resizeMethod = method; 935 }, 936 925 937 _startResizerDragging: function(event) 926 938 { … … 943 955 // Constrain the dragpoint to be within the space made up by the 944 956 // column directly to the left and the column directly to the right. 957 var leftCellIndex = resizer.leftNeighboringColumnID; 958 var rightCellIndex = resizer.rightNeighboringColumnID; 959 var firstRowCells = this.headerTableBody.rows[0].cells; 945 960 var leftEdgeOfPreviousColumn = 0; 946 var firstRowCells = this.headerTableBody.rows[0].cells; 947 for (var i = 0; i < resizer.leftNeighboringColumnID; i++) 961 for (var i = 0; i < leftCellIndex; i++) 948 962 leftEdgeOfPreviousColumn += firstRowCells[i].offsetWidth; 949 950 var rightEdgeOfNextColumn = leftEdgeOfPreviousColumn + firstRowCells[resizer.leftNeighboringColumnID].offsetWidth + firstRowCells[resizer.rightNeighboringColumnID].offsetWidth; 951 963 964 // Differences for other resize methods 965 if (this.resizeMethod == WebInspector.DataGrid.ResizeMethod.Last) { 966 rightCellIndex = this.resizers.length; 967 } else if (this.resizeMethod == WebInspector.DataGrid.ResizeMethod.First) { 968 leftEdgeOfPreviousColumn += firstRowCells[leftCellIndex].offsetWidth - firstRowCells[0].offsetWidth; 969 leftCellIndex = 0; 970 } 971 972 var rightEdgeOfNextColumn = leftEdgeOfPreviousColumn + firstRowCells[leftCellIndex].offsetWidth + firstRowCells[rightCellIndex].offsetWidth; 973 952 974 // Give each column some padding so that they don't disappear. 953 975 var leftMinimum = leftEdgeOfPreviousColumn + this.ColumnResizePadding; … … 959 981 960 982 var percentLeftColumn = (((dragPoint - leftEdgeOfPreviousColumn) / this._dataTable.offsetWidth) * 100) + "%"; 961 this._headerTableColumnGroup.children[ resizer.leftNeighboringColumnID].style.width = percentLeftColumn;962 this._dataTableColumnGroup.children[ resizer.leftNeighboringColumnID].style.width = percentLeftColumn;983 this._headerTableColumnGroup.children[leftCellIndex].style.width = percentLeftColumn; 984 this._dataTableColumnGroup.children[leftCellIndex].style.width = percentLeftColumn; 963 985 964 986 var percentRightColumn = (((rightEdgeOfNextColumn - dragPoint) / this._dataTable.offsetWidth) * 100) + "%"; 965 this._headerTableColumnGroup.children[r esizer.rightNeighboringColumnID].style.width = percentRightColumn;966 this._dataTableColumnGroup.children[r esizer.rightNeighboringColumnID].style.width = percentRightColumn;987 this._headerTableColumnGroup.children[rightCellIndex].style.width = percentRightColumn; 988 this._dataTableColumnGroup.children[rightCellIndex].style.width = percentRightColumn; 967 989 968 990 this._positionResizers(); … … 981 1003 982 1004 CenterResizerOverBorderAdjustment: 3, 1005 } 1006 1007 WebInspector.DataGrid.ResizeMethod = { 1008 Nearest: "nearest", 1009 First: "first", 1010 Last: "last" 983 1011 } 984 1012 -
trunk/Source/WebCore/inspector/front-end/NetworkPanel.js
r85316 r86855 186 186 187 187 this._dataGrid = new WebInspector.DataGrid(columns); 188 this._dataGrid.resizeMethod = WebInspector.DataGrid.ResizeMethod.Last; 188 189 this._dataGrid.element.addEventListener("contextmenu", this._contextMenu.bind(this), true); 189 190 this.containerElement.appendChild(this._dataGrid.element);
Note: See TracChangeset
for help on using the changeset viewer.