OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 return [this.sidebarElement]; | 98 return [this.sidebarElement]; |
99 }, | 99 }, |
100 | 100 |
101 show: function() | 101 show: function() |
102 { | 102 { |
103 WebInspector.Panel.prototype.show.call(this); | 103 WebInspector.Panel.prototype.show.call(this); |
104 | 104 |
105 if (this.visibleView instanceof WebInspector.ResourceView) | 105 if (this.visibleView instanceof WebInspector.ResourceView) |
106 this._showResourceView(this.visibleView.resource); | 106 this._showResourceView(this.visibleView.resource); |
107 | 107 |
| 108 this._initDefaultSelection(); |
| 109 }, |
| 110 |
| 111 loadEventFired: function() |
| 112 { |
| 113 this._initDefaultSelection(); |
| 114 }, |
| 115 |
| 116 _initDefaultSelection: function() |
| 117 { |
108 if (this._initializedDefaultSelection) | 118 if (this._initializedDefaultSelection) |
109 return; | 119 return; |
110 | 120 |
111 this._initializedDefaultSelection = true; | 121 this._initializedDefaultSelection = true; |
112 var itemURL = WebInspector.settings.resourcesLastSelectedItem; | 122 var itemURL = WebInspector.settings.resourcesLastSelectedItem; |
113 if (itemURL) { | 123 if (itemURL) { |
114 for (var treeElement = this.sidebarTree.children[0]; treeElement; tr
eeElement = treeElement.traverseNextTreeElement(false, this.sidebarTree, true))
{ | 124 for (var treeElement = this.sidebarTree.children[0]; treeElement; tr
eeElement = treeElement.traverseNextTreeElement(false, this.sidebarTree, true))
{ |
115 if (treeElement.itemURL === itemURL) { | 125 if (treeElement.itemURL === itemURL) { |
116 treeElement.select(); | 126 treeElement.select(); |
117 treeElement.reveal(); | 127 treeElement.reveal(); |
118 return; | 128 return; |
119 } | 129 } |
120 } | 130 } |
121 } | 131 } |
122 this._initDefaultSelection(); | |
123 }, | |
124 | 132 |
125 _initDefaultSelection: function() | |
126 { | |
127 if (WebInspector.mainResource && this.resourcesListTreeElement && this.r
esourcesListTreeElement.expanded) | 133 if (WebInspector.mainResource && this.resourcesListTreeElement && this.r
esourcesListTreeElement.expanded) |
128 this.showResource(WebInspector.mainResource); | 134 this.showResource(WebInspector.mainResource); |
129 }, | 135 }, |
130 | 136 |
131 reset: function() | 137 reset: function() |
132 { | 138 { |
| 139 delete this._initializedDefaultSelection; |
133 this._origins = {}; | 140 this._origins = {}; |
134 this._domains = {}; | 141 this._domains = {}; |
135 for (var i = 0; i < this._databases.length; ++i) { | 142 for (var i = 0; i < this._databases.length; ++i) { |
136 var database = this._databases[i]; | 143 var database = this._databases[i]; |
137 delete database._tableViews; | 144 delete database._tableViews; |
138 delete database._queryView; | 145 delete database._queryView; |
139 } | 146 } |
140 this._databases = []; | 147 this._databases = []; |
141 | 148 |
142 var domStorageLength = this._domStorage.length; | 149 var domStorageLength = this._domStorage.length; |
(...skipping 20 matching lines...) Expand all Loading... |
163 | 170 |
164 this.storageViewStatusBarItemsContainer.removeChildren(); | 171 this.storageViewStatusBarItemsContainer.removeChildren(); |
165 | 172 |
166 if (this.sidebarTree.selectedTreeElement) | 173 if (this.sidebarTree.selectedTreeElement) |
167 this.sidebarTree.selectedTreeElement.deselect(); | 174 this.sidebarTree.selectedTreeElement.deselect(); |
168 }, | 175 }, |
169 | 176 |
170 clear: function() | 177 clear: function() |
171 { | 178 { |
172 this.resourcesListTreeElement.removeChildren(); | 179 this.resourcesListTreeElement.removeChildren(); |
| 180 this._treeElementForFrameId = {}; |
173 this.reset(); | 181 this.reset(); |
174 }, | 182 }, |
175 | 183 |
176 addOrUpdateFrame: function(parentFrameId, frameId, title, subtitle) | 184 addOrUpdateFrame: function(parentFrameId, frameId, title, subtitle) |
177 { | 185 { |
178 var frameTreeElement = this._treeElementForFrameId[frameId]; | 186 var frameTreeElement = this._treeElementForFrameId[frameId]; |
179 if (frameTreeElement) { | 187 if (frameTreeElement) { |
180 frameTreeElement.setTitles(title, subtitle); | 188 frameTreeElement.setTitles(title, subtitle); |
181 return; | 189 return; |
182 } | 190 } |
(...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1308 } | 1316 } |
1309 | 1317 |
1310 WebInspector.StorageCategoryView.prototype = { | 1318 WebInspector.StorageCategoryView.prototype = { |
1311 setText: function(text) | 1319 setText: function(text) |
1312 { | 1320 { |
1313 this._emptyMsgElement.textContent = text; | 1321 this._emptyMsgElement.textContent = text; |
1314 } | 1322 } |
1315 } | 1323 } |
1316 | 1324 |
1317 WebInspector.StorageCategoryView.prototype.__proto__ = WebInspector.View.prototy
pe; | 1325 WebInspector.StorageCategoryView.prototype.__proto__ = WebInspector.View.prototy
pe; |
OLD | NEW |