OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Nokia Inc. All rights reserved. | 2 * Copyright (C) 2008 Nokia Inc. All rights reserved. |
3 * Copyright (C) 2013 Samsung Electronics. All rights reserved. | 3 * Copyright (C) 2013 Samsung Electronics. All rights reserved. |
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 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 { | 61 { |
62 this._update(); | 62 this._update(); |
63 }, | 63 }, |
64 | 64 |
65 willHide: function() | 65 willHide: function() |
66 { | 66 { |
67 this.deleteButton.visible = false; | 67 this.deleteButton.visible = false; |
68 }, | 68 }, |
69 | 69 |
70 /** | 70 /** |
| 71 * @param {KeyboardEvent} event |
| 72 */ |
| 73 handleShortcut: function(event) |
| 74 { |
| 75 if (WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && !event.sh
iftKey && event.keyIdentifier === "U+005A") { // Z key |
| 76 this.domStorage.undo(); |
| 77 event.handled = true; |
| 78 return; |
| 79 } |
| 80 |
| 81 var isRedoKey = WebInspector.isMac() ? event.metaKey && event.shiftKey &
& event.keyIdentifier === "U+005A" : // Z key |
| 82 event.ctrlKey && event.keyIdentif
ier === "U+0059"; // Y key |
| 83 if (isRedoKey) { |
| 84 this.domStorage.redo(); |
| 85 event.handled = true; |
| 86 return; |
| 87 } |
| 88 }, |
| 89 |
| 90 /** |
71 * @param {WebInspector.Event} event | 91 * @param {WebInspector.Event} event |
72 */ | 92 */ |
73 _domStorageItemsCleared: function(event) | 93 _domStorageItemsCleared: function(event) |
74 { | 94 { |
75 if (!this.isShowing() || !this._dataGrid) | 95 if (!this.isShowing() || !this._dataGrid) |
76 return; | 96 return; |
77 | 97 |
78 this._dataGrid.rootNode().removeChildren(); | 98 this._dataGrid.rootNode().removeChildren(); |
79 this._dataGrid.addCreationNode(false); | 99 this._dataGrid.addCreationNode(false); |
80 this.deleteButton.visible = false; | 100 this.deleteButton.visible = false; |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 { | 273 { |
254 if (!node || node.isCreationNode) | 274 if (!node || node.isCreationNode) |
255 return; | 275 return; |
256 | 276 |
257 if (this.domStorage) | 277 if (this.domStorage) |
258 this.domStorage.removeItem(node.data.key); | 278 this.domStorage.removeItem(node.data.key); |
259 }, | 279 }, |
260 | 280 |
261 __proto__: WebInspector.View.prototype | 281 __proto__: WebInspector.View.prototype |
262 } | 282 } |
OLD | NEW |