Changeset 244268 in webkit


Ignore:
Timestamp:
Apr 15, 2019 10:27:27 AM (5 years ago)
Author:
Devin Rousso
Message:

Web Inspector: sidebar panels shouldn't be added as subviews unless visible
https://bugs.webkit.org/show_bug.cgi?id=196888
<rdar://problem/49870659>

Reviewed by Timothy Hatcher.

  • UserInterface/Views/Sidebar.js:

(WI.Sidebar.prototype.insertSidebarPanel):
(WI.Sidebar.prototype.removeSidebarPanel):
(WI.Sidebar.prototype.set selectedSidebarPanel):

Location:
trunk/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r244267 r244268  
     12019-04-15  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: sidebar panels shouldn't be added as subviews unless visible
     4        https://bugs.webkit.org/show_bug.cgi?id=196888
     5        <rdar://problem/49870659>
     6
     7        Reviewed by Timothy Hatcher.
     8
     9        * UserInterface/Views/Sidebar.js:
     10        (WI.Sidebar.prototype.insertSidebarPanel):
     11        (WI.Sidebar.prototype.removeSidebarPanel):
     12        (WI.Sidebar.prototype.set selectedSidebarPanel):
     13
    1142019-04-15  Devin Rousso  <drousso@apple.com>
    215
  • trunk/Source/WebInspectorUI/UserInterface/Views/Sidebar.js

    r237196 r244268  
    7979        this._sidebarPanels.splice(index, 0, sidebarPanel);
    8080
    81         let referenceView = this._sidebarPanels[index + 1] || null;
    82         this.insertSubviewBefore(sidebarPanel, referenceView);
    83 
    8481        if (this._navigationBar) {
    8582            console.assert(sidebarPanel.navigationItem);
     
    107104
    108105        this._sidebarPanels.remove(sidebarPanel);
    109         this.removeSubview(sidebarPanel);
    110106
    111107        if (this._navigationBar) {
     
    127123
    128124        if (this._selectedSidebarPanel) {
    129             if (this._selectedSidebarPanel.visible) {
    130                 this._selectedSidebarPanel.hidden();
    131                 this._selectedSidebarPanel.visibilityDidChange();
    132             }
    133 
     125            this._selectedSidebarPanel.hidden();
     126            this._selectedSidebarPanel.visibilityDidChange();
    134127            this._selectedSidebarPanel.selected = false;
     128            this.removeSubview(this._selectedSidebarPanel);
    135129        }
    136130
     
    141135
    142136        if (this._selectedSidebarPanel) {
     137            this.addSubview(this._selectedSidebarPanel);
    143138            this._selectedSidebarPanel.selected = true;
    144 
    145             if (this._selectedSidebarPanel.visible) {
    146                 this._selectedSidebarPanel.shown();
    147                 this._selectedSidebarPanel.visibilityDidChange();
    148             }
     139            this._selectedSidebarPanel.shown();
     140            this._selectedSidebarPanel.visibilityDidChange();
    149141        }
    150142
Note: See TracChangeset for help on using the changeset viewer.