<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[172435] trunk/Source/WebInspectorUI</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/172435">172435</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-08-12 01:12:49 -0700 (Tue, 12 Aug 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Easier Way to go back to the Timeline Overviews
https://bugs.webkit.org/show_bug.cgi?id=135827

Patch by Joseph Pecoraro &lt;pecoraro@apple.com&gt; on 2014-08-12
Reviewed by Timothy Hatcher.

* Localizations/en.lproj/localizedStrings.js:
Added new tooltip UIString.

* UserInterface/Images/Close.svg:
* UserInterface/Images/CloseLarge.svg:
* UserInterface/Images/Legacy/Close.svg:
Add &quot;stroked&quot; class so the buttons can fill with white on selected rows.
Also re-center the non-legacy images horizontally.

* UserInterface/Views/GeneralTreeElement.js:
(WebInspector.GeneralTreeElement.prototype.set status):
Do not recreate elements if the status did not change.

* UserInterface/Views/LayoutTimelineView.js:
(WebInspector.LayoutTimelineView):
(WebInspector.LayoutTimelineView.prototype._treeElementDeselected):
(WebInspector.LayoutTimelineView.prototype._treeElementSelected):
(WebInspector.LayoutTimelineView.prototype._updateTreeElementWithCloseButton):
(WebInspector.LayoutTimelineView.prototype._closeStatusButtonClicked):
* UserInterface/Views/NetworkTimelineView.js:
(WebInspector.NetworkTimelineView):
(WebInspector.NetworkTimelineView.prototype._treeElementDeselected):
(WebInspector.NetworkTimelineView.prototype._treeElementSelected):
(WebInspector.NetworkTimelineView.prototype._updateTreeElementWithCloseButton):
(WebInspector.NetworkTimelineView.prototype._closeStatusButtonClicked):
* UserInterface/Views/OverviewTimelineView.js:
(WebInspector.OverviewTimelineView.prototype._treeElementDeselected):
(WebInspector.OverviewTimelineView.prototype._treeElementSelected):
(WebInspector.OverviewTimelineView.prototype._updateTreeElementWithCloseButton):
(WebInspector.OverviewTimelineView.prototype._closeStatusButtonClicked):
* UserInterface/Views/ScriptTimelineView.js:
(WebInspector.ScriptTimelineView):
(WebInspector.ScriptTimelineView.prototype._treeElementDeselected):
(WebInspector.ScriptTimelineView.prototype._treeElementSelected):
(WebInspector.ScriptTimelineView.prototype._updateTreeElementWithCloseButton):
(WebInspector.ScriptTimelineView.prototype._closeStatusButtonClicked):
Provide select/deselect handlers to show/hide the close status bar button
when selecting a row that shows a non-Timeline content view. Currently the
only content views the tree elements can show are Resource views, so the
tooltip is the same everywhere.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs">trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceImagesClosesvg">trunk/Source/WebInspectorUI/UserInterface/Images/Close.svg</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceImagesCloseLargesvg">trunk/Source/WebInspectorUI/UserInterface/Images/CloseLarge.svg</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceImagesLegacyClosesvg">trunk/Source/WebInspectorUI/UserInterface/Images/Legacy/Close.svg</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsGeneralTreeElementjs">trunk/Source/WebInspectorUI/UserInterface/Views/GeneralTreeElement.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsLayoutTimelineViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsNetworkTimelineViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsOverviewTimelineViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/OverviewTimelineView.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsScriptTimelineViewjs">trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (172434 => 172435)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2014-08-12 08:06:56 UTC (rev 172434)
+++ trunk/Source/WebInspectorUI/ChangeLog        2014-08-12 08:12:49 UTC (rev 172435)
</span><span class="lines">@@ -1,3 +1,51 @@
</span><ins>+2014-08-12  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Easier Way to go back to the Timeline Overviews
+        https://bugs.webkit.org/show_bug.cgi?id=135827
+
+        Reviewed by Timothy Hatcher.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        Added new tooltip UIString.
+
+        * UserInterface/Images/Close.svg:
+        * UserInterface/Images/CloseLarge.svg:
+        * UserInterface/Images/Legacy/Close.svg:
+        Add &quot;stroked&quot; class so the buttons can fill with white on selected rows.
+        Also re-center the non-legacy images horizontally.
+
+        * UserInterface/Views/GeneralTreeElement.js:
+        (WebInspector.GeneralTreeElement.prototype.set status):
+        Do not recreate elements if the status did not change.
+
+        * UserInterface/Views/LayoutTimelineView.js:
+        (WebInspector.LayoutTimelineView):
+        (WebInspector.LayoutTimelineView.prototype._treeElementDeselected):
+        (WebInspector.LayoutTimelineView.prototype._treeElementSelected):
+        (WebInspector.LayoutTimelineView.prototype._updateTreeElementWithCloseButton):
+        (WebInspector.LayoutTimelineView.prototype._closeStatusButtonClicked):
+        * UserInterface/Views/NetworkTimelineView.js:
+        (WebInspector.NetworkTimelineView):
+        (WebInspector.NetworkTimelineView.prototype._treeElementDeselected):
+        (WebInspector.NetworkTimelineView.prototype._treeElementSelected):
+        (WebInspector.NetworkTimelineView.prototype._updateTreeElementWithCloseButton):
+        (WebInspector.NetworkTimelineView.prototype._closeStatusButtonClicked):
+        * UserInterface/Views/OverviewTimelineView.js:
+        (WebInspector.OverviewTimelineView.prototype._treeElementDeselected):
+        (WebInspector.OverviewTimelineView.prototype._treeElementSelected):
+        (WebInspector.OverviewTimelineView.prototype._updateTreeElementWithCloseButton):
+        (WebInspector.OverviewTimelineView.prototype._closeStatusButtonClicked):
+        * UserInterface/Views/ScriptTimelineView.js:
+        (WebInspector.ScriptTimelineView):
+        (WebInspector.ScriptTimelineView.prototype._treeElementDeselected):
+        (WebInspector.ScriptTimelineView.prototype._treeElementSelected):
+        (WebInspector.ScriptTimelineView.prototype._updateTreeElementWithCloseButton):
+        (WebInspector.ScriptTimelineView.prototype._closeStatusButtonClicked):
+        Provide select/deselect handlers to show/hide the close status bar button
+        when selecting a row that shows a non-Timeline content view. Currently the
+        only content views the tree elements can show are Resource views, so the
+        tooltip is the same everywhere.
+
</ins><span class="cx"> 2014-08-12  Timothy Hatcher  &lt;timothy@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Expect to see top level JavaScript function profiler details for event handlers in timeline
</span></span></pre></div>
<a id="trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (172434 => 172435)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2014-08-12 08:06:56 UTC (rev 172434)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2014-08-12 08:12:49 UTC (rev 172435)
</span><span class="lines">@@ -91,6 +91,7 @@
</span><span class="cx"> localizedStrings[&quot;Clickable&quot;] = &quot;Clickable&quot;;
</span><span class="cx"> localizedStrings[&quot;Close&quot;] = &quot;Close&quot;;
</span><span class="cx"> localizedStrings[&quot;Close %s timeline view&quot;] = &quot;Close %s timeline view&quot;;
</span><ins>+localizedStrings[&quot;Close resource view&quot;] = &quot;Close resource view&quot;;
</ins><span class="cx"> localizedStrings[&quot;Closure Variables&quot;] = &quot;Closure Variables&quot;;
</span><span class="cx"> localizedStrings[&quot;Code&quot;] = &quot;Code&quot;;
</span><span class="cx"> localizedStrings[&quot;Collapse columns&quot;] = &quot;Collapse columns&quot;;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceImagesClosesvg"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Images/Close.svg (172434 => 172435)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Images/Close.svg        2014-08-12 08:06:56 UTC (rev 172434)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/Close.svg        2014-08-12 08:12:49 UTC (rev 172435)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
</span><span class="cx"> &lt;!-- Copyright © 2014 Apple Inc. All rights reserved. --&gt;
</span><span class="cx"> &lt;svg version=&quot;1.1&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 16 14&quot;&gt;
</span><del>-    &lt;path fill=&quot;none&quot; stroke=&quot;black&quot; stroke-linecap=&quot;square&quot; d=&quot;M 3.5 4.5 L 10.5 11.5 M 3.5 11.5 L 10.5 4.5&quot;/&gt;
</del><ins>+    &lt;path class=&quot;stroked&quot; fill=&quot;none&quot; stroke=&quot;black&quot; stroke-linecap=&quot;square&quot; d=&quot;M 4.5 4.5 L 11.5 11.5 M 4.5 11.5 L 11.5 4.5&quot;/&gt;
</ins><span class="cx"> &lt;/svg&gt;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceImagesCloseLargesvg"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Images/CloseLarge.svg (172434 => 172435)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Images/CloseLarge.svg        2014-08-12 08:06:56 UTC (rev 172434)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/CloseLarge.svg        2014-08-12 08:12:49 UTC (rev 172435)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
</span><span class="cx"> &lt;!-- Copyright © 2014 Apple Inc. All rights reserved. --&gt;
</span><span class="cx"> &lt;svg version=&quot;1.1&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 16 16&quot;&gt;
</span><del>-    &lt;path class=&quot;stroked&quot; fill=&quot;none&quot; stroke=&quot;black&quot; stroke-linecap=&quot;square&quot; d=&quot;M 1.5 2.5 L 12.5 13.5 M 1.5 13.5 L 12.5 2.5&quot;/&gt;
</del><ins>+    &lt;path class=&quot;stroked&quot; fill=&quot;none&quot; stroke=&quot;black&quot; stroke-linecap=&quot;square&quot; d=&quot;M 2.5 2.5 L 13.5 13.5 M 2.5 13.5 L 13.5 2.5&quot;/&gt;
</ins><span class="cx"> &lt;/svg&gt;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceImagesLegacyClosesvg"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Images/Legacy/Close.svg (172434 => 172435)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Images/Legacy/Close.svg        2014-08-12 08:06:56 UTC (rev 172434)
+++ trunk/Source/WebInspectorUI/UserInterface/Images/Legacy/Close.svg        2014-08-12 08:12:49 UTC (rev 172435)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
</span><span class="cx"> &lt;!-- Copyright © 2013 Apple Inc. All rights reserved. --&gt;
</span><span class="cx"> &lt;svg version=&quot;1.1&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; viewBox=&quot;0 0 16 14&quot;&gt;
</span><del>-    &lt;path d=&quot;M 12.949219 10.535156 L 11.535156 11.949219 L 8 8.414062 L 4.464844 11.949219 L 3.050781 10.535156 L 6.585938 7 L 3.050781 3.464844 L 4.464844 2.050781 L 8 5.585938 L 11.535156 2.050781 L 12.949219 3.464844 L 9.414062 7 Z&quot;/&gt;
</del><ins>+    &lt;path class=&quot;stroked&quot; d=&quot;M 12.949219 10.535156 L 11.535156 11.949219 L 8 8.414062 L 4.464844 11.949219 L 3.050781 10.535156 L 6.585938 7 L 3.050781 3.464844 L 4.464844 2.050781 L 8 5.585938 L 11.535156 2.050781 L 12.949219 3.464844 L 9.414062 7 Z&quot;/&gt;
</ins><span class="cx"> &lt;/svg&gt;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsGeneralTreeElementjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/GeneralTreeElement.js (172434 => 172435)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/GeneralTreeElement.js        2014-08-12 08:06:56 UTC (rev 172434)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/GeneralTreeElement.js        2014-08-12 08:12:49 UTC (rev 172435)
</span><span class="lines">@@ -202,6 +202,9 @@
</span><span class="cx"> 
</span><span class="cx">     set status(x)
</span><span class="cx">     {
</span><ins>+        if (this._status === x)
+            return;
+
</ins><span class="cx">         this._status = x || &quot;&quot;;
</span><span class="cx">         this._updateStatusElement();
</span><span class="cx">     },
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsLayoutTimelineViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineView.js (172434 => 172435)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineView.js        2014-08-12 08:06:56 UTC (rev 172434)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/LayoutTimelineView.js        2014-08-12 08:12:49 UTC (rev 172435)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx">     console.assert(timeline.type === WebInspector.TimelineRecord.Type.Layout);
</span><span class="cx"> 
</span><span class="cx">     this.navigationSidebarTreeOutline.onselect = this._treeElementSelected.bind(this);
</span><ins>+    this.navigationSidebarTreeOutline.ondeselect = this._treeElementDeselected.bind(this);
</ins><span class="cx">     this.navigationSidebarTreeOutline.element.classList.add(WebInspector.NavigationSidebarPanel.HideDisclosureButtonsStyleClassName);
</span><span class="cx">     this.navigationSidebarTreeOutline.element.classList.add(WebInspector.LayoutTimelineView.TreeOutlineStyleClassName);
</span><span class="cx"> 
</span><span class="lines">@@ -171,6 +172,12 @@
</span><span class="cx">         this.dispatchEventToListeners(WebInspector.TimelineView.Event.SelectionPathComponentsDidChange);
</span><span class="cx">     },
</span><span class="cx"> 
</span><ins>+    _treeElementDeselected: function(treeElement)
+    {
+        if (treeElement.status)
+            treeElement.status = &quot;&quot;;
+    },
+
</ins><span class="cx">     _treeElementSelected: function(treeElement, selectedByUser)
</span><span class="cx">     {
</span><span class="cx">         if (this._dataGrid.shouldIgnoreSelectionEvent())
</span><span class="lines">@@ -193,5 +200,27 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         WebInspector.resourceSidebarPanel.showOriginalOrFormattedSourceCodeLocation(treeElement.record.sourceCodeLocation);
</span><ins>+        this._updateTreeElementWithCloseButton(treeElement);
+    },
+
+    _updateTreeElementWithCloseButton: function(treeElement)
+    {
+        if (this._closeStatusButton) {
+            treeElement.status = this._closeStatusButton.element;
+            return;
+        }
+
+        wrappedSVGDocument(platformImagePath(&quot;Close.svg&quot;), null, WebInspector.UIString(&quot;Close resource view&quot;), function(element) {
+            this._closeStatusButton = new WebInspector.TreeElementStatusButton(element);
+            this._closeStatusButton.addEventListener(WebInspector.TreeElementStatusButton.Event.Clicked, this._closeStatusButtonClicked, this);
+            if (treeElement === this.navigationSidebarTreeOutline.selectedTreeElement)
+                this._updateTreeElementWithCloseButton(treeElement);
+        }.bind(this));
+    },
+
+    _closeStatusButtonClicked: function(event)
+    {
+        this.navigationSidebarTreeOutline.selectedTreeElement.deselect();
+        WebInspector.timelineSidebarPanel.showTimelineViewForType(WebInspector.TimelineRecord.Type.Layout);
</ins><span class="cx">     }
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsNetworkTimelineViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.js (172434 => 172435)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.js        2014-08-12 08:06:56 UTC (rev 172434)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NetworkTimelineView.js        2014-08-12 08:12:49 UTC (rev 172435)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx">     console.assert(timeline.type === WebInspector.TimelineRecord.Type.Network);
</span><span class="cx"> 
</span><span class="cx">     this.navigationSidebarTreeOutline.onselect = this._treeElementSelected.bind(this);
</span><ins>+    this.navigationSidebarTreeOutline.ondeselect = this._treeElementDeselected.bind(this);    
</ins><span class="cx">     this.navigationSidebarTreeOutline.element.classList.add(WebInspector.NavigationSidebarPanel.HideDisclosureButtonsStyleClassName);
</span><span class="cx">     this.navigationSidebarTreeOutline.element.classList.add(WebInspector.NetworkTimelineView.TreeOutlineStyleClassName);
</span><span class="cx"> 
</span><span class="lines">@@ -192,6 +193,12 @@
</span><span class="cx">         this.dispatchEventToListeners(WebInspector.TimelineView.Event.SelectionPathComponentsDidChange);
</span><span class="cx">     },
</span><span class="cx"> 
</span><ins>+    _treeElementDeselected: function(treeElement)
+    {
+        if (treeElement.status)
+            treeElement.status = &quot;&quot;;
+    },
+
</ins><span class="cx">     _treeElementSelected: function(treeElement, selectedByUser)
</span><span class="cx">     {
</span><span class="cx">         if (this._dataGrid.shouldIgnoreSelectionEvent())
</span><span class="lines">@@ -205,9 +212,31 @@
</span><span class="cx"> 
</span><span class="cx">         if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement) {
</span><span class="cx">             WebInspector.resourceSidebarPanel.showSourceCode(treeElement.representedObject);
</span><ins>+            this._updateTreeElementWithCloseButton(treeElement);
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         console.error(&quot;Unknown tree element selected.&quot;);
</span><ins>+    },
+
+    _updateTreeElementWithCloseButton: function(treeElement)
+    {
+        if (this._closeStatusButton) {
+            treeElement.status = this._closeStatusButton.element;
+            return;
+        }
+
+        wrappedSVGDocument(platformImagePath(&quot;Close.svg&quot;), null, WebInspector.UIString(&quot;Close resource view&quot;), function(element) {
+            this._closeStatusButton = new WebInspector.TreeElementStatusButton(element);
+            this._closeStatusButton.addEventListener(WebInspector.TreeElementStatusButton.Event.Clicked, this._closeStatusButtonClicked, this);
+            if (treeElement === this.navigationSidebarTreeOutline.selectedTreeElement)
+                this._updateTreeElementWithCloseButton(treeElement);
+        }.bind(this));
+    },
+
+    _closeStatusButtonClicked: function(event)
+    {
+        this.navigationSidebarTreeOutline.selectedTreeElement.deselect();
+        WebInspector.timelineSidebarPanel.showTimelineViewForType(WebInspector.TimelineRecord.Type.Network);
</ins><span class="cx">     }
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsOverviewTimelineViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/OverviewTimelineView.js (172434 => 172435)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/OverviewTimelineView.js        2014-08-12 08:06:56 UTC (rev 172434)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/OverviewTimelineView.js        2014-08-12 08:12:49 UTC (rev 172435)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx">     WebInspector.TimelineView.call(this, recording);
</span><span class="cx"> 
</span><span class="cx">     this.navigationSidebarTreeOutline.onselect = this._treeElementSelected.bind(this);
</span><ins>+    this.navigationSidebarTreeOutline.ondeselect = this._treeElementDeselected.bind(this);
</ins><span class="cx"> 
</span><span class="cx">     this._recording = recording;
</span><span class="cx"> 
</span><span class="lines">@@ -330,6 +331,12 @@
</span><span class="cx">         this.dispatchEventToListeners(WebInspector.TimelineView.Event.SelectionPathComponentsDidChange);
</span><span class="cx">     },
</span><span class="cx"> 
</span><ins>+    _treeElementDeselected: function(treeElement)
+    {
+        if (treeElement.status)
+            treeElement.status = &quot;&quot;;
+    },
+
</ins><span class="cx">     _treeElementSelected: function(treeElement, selectedByUser)
</span><span class="cx">     {
</span><span class="cx">         if (!WebInspector.timelineSidebarPanel.canShowDifferentContentView())
</span><span class="lines">@@ -340,6 +347,7 @@
</span><span class="cx"> 
</span><span class="cx">         if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement) {
</span><span class="cx">             WebInspector.resourceSidebarPanel.showSourceCode(treeElement.representedObject);
</span><ins>+            this._updateTreeElementWithCloseButton(treeElement);
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -354,5 +362,27 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         WebInspector.resourceSidebarPanel.showOriginalOrFormattedSourceCodeLocation(treeElement.sourceCodeTimeline.sourceCodeLocation);
</span><ins>+        this._updateTreeElementWithCloseButton(treeElement);
+    },
+
+    _updateTreeElementWithCloseButton: function(treeElement)
+    {
+        if (this._closeStatusButton) {
+            treeElement.status = this._closeStatusButton.element;
+            return;
+        }
+
+        wrappedSVGDocument(platformImagePath(&quot;Close.svg&quot;), null, WebInspector.UIString(&quot;Close resource view&quot;), function(element) {
+            this._closeStatusButton = new WebInspector.TreeElementStatusButton(element);
+            this._closeStatusButton.addEventListener(WebInspector.TreeElementStatusButton.Event.Clicked, this._closeStatusButtonClicked, this);
+            if (treeElement === this.navigationSidebarTreeOutline.selectedTreeElement)
+                this._updateTreeElementWithCloseButton(treeElement);
+        }.bind(this));
+    },
+
+    _closeStatusButtonClicked: function(event)
+    {
+        this.navigationSidebarTreeOutline.selectedTreeElement.deselect();
+        WebInspector.timelineSidebarPanel.showTimelineOverview();
</ins><span class="cx">     }
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsScriptTimelineViewjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.js (172434 => 172435)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.js        2014-08-12 08:06:56 UTC (rev 172434)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScriptTimelineView.js        2014-08-12 08:12:49 UTC (rev 172435)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx">     console.assert(timeline.type === WebInspector.TimelineRecord.Type.Script);
</span><span class="cx"> 
</span><span class="cx">     this.navigationSidebarTreeOutline.onselect = this._treeElementSelected.bind(this);
</span><ins>+    this.navigationSidebarTreeOutline.ondeselect = this._treeElementDeselected.bind(this);
</ins><span class="cx">     this.navigationSidebarTreeOutline.element.classList.add(WebInspector.ScriptTimelineView.TreeOutlineStyleClassName);
</span><span class="cx"> 
</span><span class="cx">     var columns = {location: {}, callCount: {}, startTime: {}, totalTime: {}, selfTime: {}, averageTime: {}};
</span><span class="lines">@@ -246,6 +247,12 @@
</span><span class="cx">         this.dispatchEventToListeners(WebInspector.TimelineView.Event.SelectionPathComponentsDidChange);
</span><span class="cx">     },
</span><span class="cx"> 
</span><ins>+    _treeElementDeselected: function(treeElement)
+    {
+        if (treeElement.status)
+            treeElement.status = &quot;&quot;;
+    },
+
</ins><span class="cx">     _treeElementSelected: function(treeElement, selectedByUser)
</span><span class="cx">     {
</span><span class="cx">         if (this._dataGrid.shouldIgnoreSelectionEvent())
</span><span class="lines">@@ -271,5 +278,27 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         WebInspector.resourceSidebarPanel.showOriginalOrFormattedSourceCodeLocation(sourceCodeLocation);
</span><ins>+        this._updateTreeElementWithCloseButton(treeElement);
+    },
+
+    _updateTreeElementWithCloseButton: function(treeElement)
+    {
+        if (this._closeStatusButton) {
+            treeElement.status = this._closeStatusButton.element;
+            return;
+        }
+
+        wrappedSVGDocument(platformImagePath(&quot;Close.svg&quot;), null, WebInspector.UIString(&quot;Close resource view&quot;), function(element) {
+            this._closeStatusButton = new WebInspector.TreeElementStatusButton(element);
+            this._closeStatusButton.addEventListener(WebInspector.TreeElementStatusButton.Event.Clicked, this._closeStatusButtonClicked, this);
+            if (treeElement === this.navigationSidebarTreeOutline.selectedTreeElement)
+                this._updateTreeElementWithCloseButton(treeElement);
+        }.bind(this));
+    },
+
+    _closeStatusButtonClicked: function(event)
+    {
+        this.navigationSidebarTreeOutline.selectedTreeElement.deselect();
+        WebInspector.timelineSidebarPanel.showTimelineViewForType(WebInspector.TimelineRecord.Type.Script);
</ins><span class="cx">     }
</span><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>