Changeset 289670 in webkit


Ignore:
Timestamp:
Feb 11, 2022 1:48:12 PM (5 months ago)
Author:
Devin Rousso
Message:

Web Inspector: Sources: double clicking a breakpoint icon should show the edit popover
https://bugs.webkit.org/show_bug.cgi?id=236524

Reviewed by Patrick Angle.

This is a more convenient way to access(/discover) the breakpoint's configuration details.

  • UserInterface/Views/BreakpointTreeElement.js:

(WI.BreakpointTreeElement):
(WI.BreakpointTreeElement.prototype._handleStatusImageElementDoubleClicked): Added.

  • UserInterface/Views/BreakpointPopover.js:

(WI.BreakpointPopover.show): Added.
(WI.BreakpointPopover.appendContextMenuItems):
Add a convenience method to create a WI.BreakpointPopover (or subclass) for the given
breakpoint and show it over the given target element.

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r289669 r289670  
     12022-02-11  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Sources: double clicking a breakpoint icon should show the edit popover
     4        https://bugs.webkit.org/show_bug.cgi?id=236524
     5
     6        Reviewed by Patrick Angle.
     7
     8        This is a more convenient way to access(/discover) the breakpoint's configuration details.
     9
     10        * UserInterface/Views/BreakpointTreeElement.js:
     11        (WI.BreakpointTreeElement):
     12        (WI.BreakpointTreeElement.prototype._handleStatusImageElementDoubleClicked): Added.
     13
     14        * UserInterface/Views/BreakpointPopover.js:
     15        (WI.BreakpointPopover.show): Added.
     16        (WI.BreakpointPopover.appendContextMenuItems):
     17        Add a convenience method to create a `WI.BreakpointPopover` (or subclass) for the given
     18        breakpoint and `show` it over the given target element.
     19
    1202022-02-11  Devin Rousso  <drousso@apple.com>
    221
  • trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointPopover.js

    r269547 r289670  
    5151    // Static
    5252
     53    static show(breakpoint, targetElement)
     54    {
     55        const delegate = null;
     56        let popover;
     57        if (breakpoint instanceof WI.EventBreakpoint)
     58            popover = new WI.EventBreakpointPopover(delegate, breakpoint);
     59        else if (breakpoint instanceof WI.URLBreakpoint)
     60            popover = new WI.URLBreakpointPopover(delegate, breakpoint);
     61        else
     62            popover = new WI.BreakpointPopover(delegate, breakpoint);
     63        popover.show(targetElement);
     64    }
     65
    5366    static appendContextMenuItems(contextMenu, breakpoint, targetElement)
    5467    {
    5568        if (breakpoint.editable && targetElement) {
    5669            contextMenu.appendItem(WI.UIString("Edit Breakpoint\u2026"), () => {
    57                 const delegate = null;
    58                 let popover;
    59                 if (breakpoint instanceof WI.EventBreakpoint)
    60                     popover = new WI.EventBreakpointPopover(delegate, breakpoint);
    61                 else if (breakpoint instanceof WI.URLBreakpoint)
    62                     popover = new WI.URLBreakpointPopover(delegate, breakpoint);
    63                 else
    64                     popover = new WI.BreakpointPopover(delegate, breakpoint);
    65                 popover.show(targetElement);
     70                WI.BreakpointPopover.show(breakpoint, targetElement);
    6671            });
    6772        }
  • trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.js

    r289669 r289670  
    4646        this.status.addEventListener("mousedown", this._statusImageElementMouseDown.bind(this));
    4747        this.status.addEventListener("click", this._statusImageElementClicked.bind(this));
     48        this.status.addEventListener("dblclick", this._handleStatusImageElementDoubleClicked.bind(this));
    4849
    4950        this.updateStatus();
     
    218219        this._breakpoint.disabled = !this._breakpoint.disabled;
    219220    }
     221
     222    _handleStatusImageElementDoubleClicked(event)
     223    {
     224        WI.BreakpointPopover.show(this._breakpoint, this.status);
     225    }
    220226};
    221227
Note: See TracChangeset for help on using the changeset viewer.