Web Inspector: Canvas recording sidebar scroll position lost after switching tabs
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Oct 2018 19:13:15 +0000 (19:13 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Oct 2018 19:13:15 +0000 (19:13 +0000)
commitbe96505024fe4c659a5b05eb7671ac87f25f6cbc
tree52a7d886bc7c5e2111465c032182a7309bce5af9
parente729d8925b695cb9d88bd9fdca0b7436e6f6fedd
Web Inspector: Canvas recording sidebar scroll position lost after switching tabs
https://bugs.webkit.org/show_bug.cgi?id=190482

Reviewed by Joseph Pecoraro.

* UserInterface/Views/Sidebar.js:
(WI.Sidebar.prototype.removeSidebarPanel):
(WI.Sidebar.prototype.set selectedSidebarPanel):
Call `hidden` before setting `selected` to `false`, as that sets `display: none;` on the
element, which sets the `scrollTop` to `0`.

* UserInterface/Views/SidebarPanel.js:
(WI.SidebarPanel.prototype.shown):
(WI.SidebarPanel.prototype.hidden):
(WI.SidebarPanel.prototype.get scrollElement): Added.
Allow subclasses to specify the scrolling element for saving/restoring the scroll position.

* UserInterface/Views/CanvasSidebarPanel.js:
(WI.CanvasSidebarPanel.prototype.get scrollElement): Added.
* UserInterface/Views/RecordingStateDetailsSidebarPanel.js:
(WI.RecordingStateDetailsSidebarPanel.prototype.get scrollElement): Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237196 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/CanvasSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/RecordingStateDetailsSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/Sidebar.js
Source/WebInspectorUI/UserInterface/Views/SidebarPanel.js