OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
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 * | 10 * |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
177 _sourceSelected: function(uiSourceCode, focusSource) | 177 _sourceSelected: function(uiSourceCode, focusSource) |
178 { | 178 { |
179 this._lastSelectedUISourceCode = uiSourceCode; | 179 this._lastSelectedUISourceCode = uiSourceCode; |
180 var data = { uiSourceCode: uiSourceCode, focusSource: focusSource}; | 180 var data = { uiSourceCode: uiSourceCode, focusSource: focusSource}; |
181 this.dispatchEventToListeners(WebInspector.NavigatorView.Events.ItemSele cted, data); | 181 this.dispatchEventToListeners(WebInspector.NavigatorView.Events.ItemSele cted, data); |
182 }, | 182 }, |
183 | 183 |
184 /** | 184 /** |
185 * @param {WebInspector.UISourceCode} uiSourceCode | 185 * @param {WebInspector.UISourceCode} uiSourceCode |
186 */ | 186 */ |
187 _sourceDeleted: function(uiSourceCode) | |
vsevik
2013/09/27 12:23:18
Please rename it to sourceDeleted. Underscore mean
| |
188 { | |
189 }, | |
190 | |
191 /** | |
192 * @param {WebInspector.UISourceCode} uiSourceCode | |
193 */ | |
187 removeUISourceCode: function(uiSourceCode) | 194 removeUISourceCode: function(uiSourceCode) |
188 { | 195 { |
189 var node = this._uiSourceCodeNodes.get(uiSourceCode); | 196 var node = this._uiSourceCodeNodes.get(uiSourceCode); |
190 if (!node) | 197 if (!node) |
191 return; | 198 return; |
192 | 199 |
193 var projectNode = this._projectNode(uiSourceCode.project()); | 200 var projectNode = this._projectNode(uiSourceCode.project()); |
194 var subfolderNodes = this._subfolderNodes.get(projectNode); | 201 var subfolderNodes = this._subfolderNodes.get(projectNode); |
195 var parentNode = node.parent; | 202 var parentNode = node.parent; |
196 this._uiSourceCodeNodes.remove(uiSourceCode); | 203 this._uiSourceCodeNodes.remove(uiSourceCode); |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
669 var middleClick = event.button === 1; | 676 var middleClick = event.button === 1; |
670 this._navigatorView._sourceSelected(this.uiSourceCode, !middleClick); | 677 this._navigatorView._sourceSelected(this.uiSourceCode, !middleClick); |
671 }, | 678 }, |
672 | 679 |
673 onenter: function() | 680 onenter: function() |
674 { | 681 { |
675 this._navigatorView._sourceSelected(this.uiSourceCode, true); | 682 this._navigatorView._sourceSelected(this.uiSourceCode, true); |
676 return true; | 683 return true; |
677 }, | 684 }, |
678 | 685 |
686 ondelete: function() | |
687 { | |
688 this._navigatorView._sourceDeleted(this.uiSourceCode); | |
689 return true; | |
690 }, | |
691 | |
679 /** | 692 /** |
680 * @param {Event} event | 693 * @param {Event} event |
681 */ | 694 */ |
682 _handleContextMenuEvent: function(event) | 695 _handleContextMenuEvent: function(event) |
683 { | 696 { |
684 this.select(); | 697 this.select(); |
685 this._navigatorView.handleFileContextMenu(event, this._uiSourceCode); | 698 this._navigatorView.handleFileContextMenu(event, this._uiSourceCode); |
686 }, | 699 }, |
687 | 700 |
688 __proto__: WebInspector.BaseNavigatorTreeElement.prototype | 701 __proto__: WebInspector.BaseNavigatorTreeElement.prototype |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1150 | 1163 |
1151 willRemoveChild: function(node) | 1164 willRemoveChild: function(node) |
1152 { | 1165 { |
1153 if (node._isMerged || !this.isPopulated()) | 1166 if (node._isMerged || !this.isPopulated()) |
1154 return; | 1167 return; |
1155 this._treeElement.removeChild(node._treeElement); | 1168 this._treeElement.removeChild(node._treeElement); |
1156 }, | 1169 }, |
1157 | 1170 |
1158 __proto__: WebInspector.NavigatorTreeNode.prototype | 1171 __proto__: WebInspector.NavigatorTreeNode.prototype |
1159 } | 1172 } |
OLD | NEW |