Changeset 205676 in webkit


Ignore:
Timestamp:
Sep 8, 2016 4:21:27 PM (8 years ago)
Author:
Matt Baker
Message:

Web Inspector: TimelineDataGridNode should refresh when graph column is resized
https://bugs.webkit.org/show_bug.cgi?id=161765
<rdar://problem/28215674>

Reviewed by Brian Burg.

  • UserInterface/Views/DataGrid.js:

(WebInspector.DataGrid.prototype.resizerDragging):
Call DataGridNode.didResizeColumn for all visible nodes in the columns
to the left and right of the column resizer.

  • UserInterface/Views/DataGridNode.js:

(WebInspector.DataGridNode.prototype.didResizeColumn):
Add protected base class method for subclasses to override.

  • UserInterface/Views/TimelineDataGridNode.js:

(WebInspector.TimelineDataGridNode.prototype.didResizeColumn):
Refresh the node's graph when the "graph" column is resized.
Renamed left/rightCellIndex -> left/rightColumnIndex.

Location:
trunk/Source/WebInspectorUI
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r205674 r205676  
     12016-09-08  Matt Baker  <mattbaker@apple.com>
     2
     3        Web Inspector: TimelineDataGridNode should refresh when graph column is resized
     4        https://bugs.webkit.org/show_bug.cgi?id=161765
     5        <rdar://problem/28215674>
     6
     7        Reviewed by Brian Burg.
     8
     9        * UserInterface/Views/DataGrid.js:
     10        (WebInspector.DataGrid.prototype.resizerDragging):
     11        Call `DataGridNode.didResizeColumn` for all visible nodes in the columns
     12        to the left and right of the column resizer.
     13
     14        * UserInterface/Views/DataGridNode.js:
     15        (WebInspector.DataGridNode.prototype.didResizeColumn):
     16        Add protected base class method for subclasses to override.
     17
     18        * UserInterface/Views/TimelineDataGridNode.js:
     19        (WebInspector.TimelineDataGridNode.prototype.didResizeColumn):
     20        Refresh the node's graph when the "graph" column is resized.
     21        Renamed `left/rightCellIndex` -> `left/rightColumnIndex`.
     22
    1232016-09-08  Nikita Vasilyev  <nvasilyev@apple.com>
    224
  • trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js

    r205578 r205676  
    17841784        // Constrain the dragpoint to be within the space made up by the
    17851785        // column directly to the left and the column directly to the right.
    1786         var leftCellIndex = resizer[WebInspector.DataGrid.PreviousColumnOrdinalSymbol];
    1787         var rightCellIndex = resizer[WebInspector.DataGrid.NextColumnOrdinalSymbol];
     1786        var leftColumnIndex = resizer[WebInspector.DataGrid.PreviousColumnOrdinalSymbol];
     1787        var rightColumnIndex = resizer[WebInspector.DataGrid.NextColumnOrdinalSymbol];
    17881788        var firstRowCells = this._headerTableBodyElement.rows[0].cells;
    17891789        var leftEdgeOfPreviousColumn = 0;
    1790         for (var i = 0; i < leftCellIndex; i++)
     1790        for (var i = 0; i < leftColumnIndex; i++)
    17911791            leftEdgeOfPreviousColumn += firstRowCells[i].offsetWidth;
    17921792
    17931793        // Differences for other resize methods
    17941794        if (this.resizeMethod === WebInspector.DataGrid.ResizeMethod.Last) {
    1795             rightCellIndex = this.resizers.length;
     1795            rightColumnIndex = this.resizers.length;
    17961796        } else if (this.resizeMethod === WebInspector.DataGrid.ResizeMethod.First) {
    1797             leftEdgeOfPreviousColumn += firstRowCells[leftCellIndex].offsetWidth - firstRowCells[0].offsetWidth;
    1798             leftCellIndex = 0;
    1799         }
    1800 
    1801         var rightEdgeOfNextColumn = leftEdgeOfPreviousColumn + firstRowCells[leftCellIndex].offsetWidth + firstRowCells[rightCellIndex].offsetWidth;
     1797            leftEdgeOfPreviousColumn += firstRowCells[leftColumnIndex].offsetWidth - firstRowCells[0].offsetWidth;
     1798            leftColumnIndex = 0;
     1799        }
     1800
     1801        var rightEdgeOfNextColumn = leftEdgeOfPreviousColumn + firstRowCells[leftColumnIndex].offsetWidth + firstRowCells[rightColumnIndex].offsetWidth;
    18021802
    18031803        // Give each column some padding so that they don't disappear.
     
    18101810
    18111811        var percentLeftColumn = (((dragPoint - leftEdgeOfPreviousColumn) / this._dataTableElement.offsetWidth) * 100) + "%";
    1812         this._headerTableColumnGroupElement.children[leftCellIndex].style.width = percentLeftColumn;
    1813         this._dataTableColumnGroupElement.children[leftCellIndex].style.width = percentLeftColumn;
     1812        this._headerTableColumnGroupElement.children[leftColumnIndex].style.width = percentLeftColumn;
     1813        this._dataTableColumnGroupElement.children[leftColumnIndex].style.width = percentLeftColumn;
    18141814
    18151815        var percentRightColumn = (((rightEdgeOfNextColumn - dragPoint) / this._dataTableElement.offsetWidth) * 100) + "%";
    1816         this._headerTableColumnGroupElement.children[rightCellIndex].style.width = percentRightColumn;
    1817         this._dataTableColumnGroupElement.children[rightCellIndex].style.width = percentRightColumn;
     1816        this._headerTableColumnGroupElement.children[rightColumnIndex].style.width = percentRightColumn;
     1817        this._dataTableColumnGroupElement.children[rightColumnIndex].style.width = percentRightColumn;
    18181818
    18191819        this._positionResizerElements();
    18201820        this._positionHeaderViews();
     1821
     1822        const skipHidden = true;
     1823        const dontPopulate = true;
     1824
     1825        let leftColumnIdentifier = this.orderedColumns[leftColumnIndex];
     1826        let rightColumnIdentifier = this.orderedColumns[rightColumnIndex];
     1827        let child = this.children[0];
     1828
     1829        while (child) {
     1830            child.didResizeColumn(leftColumnIdentifier);
     1831            child.didResizeColumn(rightColumnIdentifier);
     1832            child = child.traverseNextNode(skipHidden, this, dontPopulate);
     1833        }
     1834
    18211835        event.preventDefault();
    18221836    }
  • trunk/Source/WebInspectorUI/UserInterface/Views/DataGridNode.js

    r205425 r205676  
    733733        return typeof value === "string" ? value : null;
    734734    }
     735
     736    didResizeColumn(columnIdentifier)
     737    {
     738        // Override by subclasses.
     739    }
    735740};
    736741
  • trunk/Source/WebInspectorUI/UserInterface/Views/TimelineDataGridNode.js

    r205578 r205676  
    390390        // Implemented by subclasses.
    391391    }
     392
     393    didResizeColumn(columnIdentifier)
     394    {
     395        if (columnIdentifier !== "graph")
     396            return;
     397
     398        this.needsGraphRefresh();
     399    }
    392400};
Note: See TracChangeset for help on using the changeset viewer.