Changeset 195966 in webkit


Ignore:
Timestamp:
Feb 1, 2016 10:22:37 AM (8 years ago)
Author:
Matt Baker
Message:

Web Inspector: DataGridNode should support adding go-to arrow buttons to any cell
https://bugs.webkit.org/show_bug.cgi?id=153733
<rdar://problem/24431813>

Reviewed by Brian Burg.

Provide a way to add go-to arrow buttons to any grid cell from within a
DataGridNode subclass's implementation of createCellContent.

  • UserInterface/Views/DataGrid.js:

New event type, GoToArrowClicked.
(WebInspector.DataGridNode.prototype.createGoToArrowButton.buttonClicked):
(WebInspector.DataGridNode.prototype.createGoToArrowButton):
Adds a go-to arrow button to the cell's content element. Clicking the button
dispatches an event on the DataGrid, with event data containing the
DataGridNode and identifier of the cell containing the arrow button.

Location:
trunk/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r195953 r195966  
     12016-02-01  Matt Baker  <mattbaker@apple.com>
     2
     3        Web Inspector: DataGridNode should support adding go-to arrow buttons to any cell
     4        https://bugs.webkit.org/show_bug.cgi?id=153733
     5        <rdar://problem/24431813>
     6
     7        Reviewed by Brian Burg.
     8
     9        Provide a way to add go-to arrow buttons to any grid cell from within a
     10        DataGridNode subclass's implementation of createCellContent.
     11
     12        * UserInterface/Views/DataGrid.js:
     13        New event type, GoToArrowClicked.
     14        (WebInspector.DataGridNode.prototype.createGoToArrowButton.buttonClicked):
     15        (WebInspector.DataGridNode.prototype.createGoToArrowButton):
     16        Adds a go-to arrow button to the cell's content element. Clicking the button
     17        dispatches an event on the DataGrid, with event data containing the
     18        DataGridNode and identifier of the cell containing the arrow button.
     19
    1202016-01-31  Jeremy Jones  <jeremyj@apple.com>
    221
  • trunk/Source/WebInspectorUI/UserInterface/Views/DataGrid.js

    r195522 r195966  
    13451345    SelectedNodeChanged: "datagrid-selected-node-changed",
    13461346    ExpandedNode: "datagrid-expanded-node",
    1347     CollapsedNode: "datagrid-collapsed-node"
     1347    CollapsedNode: "datagrid-collapsed-node",
     1348    GoToArrowClicked: "datagrid-go-to-arrow-clicked"
    13481349};
    13491350
     
    14551456    }
    14561457
     1458    createGoToArrowButton(cellElement)
     1459    {
     1460        function buttonClicked(event)
     1461        {
     1462            if (this.hidden || !this.revealed)
     1463                return;
     1464
     1465            event.stopPropagation();
     1466
     1467            let columnIdentifier = cellElement.__columnIdentifier;
     1468            this.dataGrid.dispatchEventToListeners(WebInspector.DataGrid.Event.GoToArrowClicked, {dataGridNode: this, columnIdentifier});
     1469        }
     1470
     1471        let button = WebInspector.createGoToArrowButton();
     1472        button.addEventListener("click", buttonClicked.bind(this));
     1473
     1474        let contentElement = cellElement.firstChild;
     1475        contentElement.appendChild(button);
     1476    }
     1477
    14571478    refreshIfNeeded()
    14581479    {
Note: See TracChangeset for help on using the changeset viewer.