OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 18 matching lines...) Expand all Loading... |
29 Resources.ApplicationCacheItemsView = class extends UI.SimpleView { | 29 Resources.ApplicationCacheItemsView = class extends UI.SimpleView { |
30 constructor(model, frameId) { | 30 constructor(model, frameId) { |
31 super(Common.UIString('AppCache')); | 31 super(Common.UIString('AppCache')); |
32 | 32 |
33 this._model = model; | 33 this._model = model; |
34 | 34 |
35 this.element.classList.add('storage-view', 'table'); | 35 this.element.classList.add('storage-view', 'table'); |
36 | 36 |
37 this._deleteButton = new UI.ToolbarButton(Common.UIString('Delete'), 'largei
con-delete'); | 37 this._deleteButton = new UI.ToolbarButton(Common.UIString('Delete'), 'largei
con-delete'); |
38 this._deleteButton.setVisible(false); | 38 this._deleteButton.setVisible(false); |
39 this._deleteButton.addEventListener('click', this._deleteButtonClicked, this
); | 39 this._deleteButton.addEventListener(UI.ToolbarButton.Events.Click, this._del
eteButtonClicked, this); |
40 | 40 |
41 this._connectivityIcon = createElement('label', 'dt-icon-label'); | 41 this._connectivityIcon = createElement('label', 'dt-icon-label'); |
42 this._connectivityIcon.style.margin = '0 2px 0 5px'; | 42 this._connectivityIcon.style.margin = '0 2px 0 5px'; |
43 this._statusIcon = createElement('label', 'dt-icon-label'); | 43 this._statusIcon = createElement('label', 'dt-icon-label'); |
44 this._statusIcon.style.margin = '0 2px 0 5px'; | 44 this._statusIcon.style.margin = '0 2px 0 5px'; |
45 | 45 |
46 this._frameId = frameId; | 46 this._frameId = frameId; |
47 | 47 |
48 this._emptyWidget = new UI.EmptyWidget(Common.UIString('No Application Cache
information available.')); | 48 this._emptyWidget = new UI.EmptyWidget(Common.UIString('No Application Cache
information available.')); |
49 this._emptyWidget.show(this.element); | 49 this._emptyWidget.show(this.element); |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 if (resource === selectedResource) { | 232 if (resource === selectedResource) { |
233 nodeToSelect = node; | 233 nodeToSelect = node; |
234 nodeToSelect.selected = true; | 234 nodeToSelect.selected = true; |
235 } | 235 } |
236 } | 236 } |
237 | 237 |
238 if (!nodeToSelect && this._dataGrid.rootNode().children.length) | 238 if (!nodeToSelect && this._dataGrid.rootNode().children.length) |
239 this._dataGrid.rootNode().children[0].selected = true; | 239 this._dataGrid.rootNode().children[0].selected = true; |
240 } | 240 } |
241 | 241 |
| 242 /** |
| 243 * @param {!Common.Event} event |
| 244 */ |
242 _deleteButtonClicked(event) { | 245 _deleteButtonClicked(event) { |
243 if (!this._dataGrid || !this._dataGrid.selectedNode) | 246 if (!this._dataGrid || !this._dataGrid.selectedNode) |
244 return; | 247 return; |
245 | 248 |
246 // FIXME: Delete Button semantics are not yet defined. (Delete a single, or
all?) | 249 // FIXME: Delete Button semantics are not yet defined. (Delete a single, or
all?) |
247 this._deleteCallback(this._dataGrid.selectedNode); | 250 this._deleteCallback(this._dataGrid.selectedNode); |
248 } | 251 } |
249 | 252 |
250 _deleteCallback(node) { | 253 _deleteCallback(node) { |
251 // FIXME: Should we delete a single (selected) resource or all resources? | 254 // FIXME: Should we delete a single (selected) resource or all resources? |
252 // InspectorBackend.deleteCachedResource(...) | 255 // InspectorBackend.deleteCachedResource(...) |
253 // this._update(); | 256 // this._update(); |
254 } | 257 } |
255 }; | 258 }; |
OLD | NEW |