OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 | 212 |
213 for (var i = 0; i < uiSourceCodeList.length; ++i) | 213 for (var i = 0; i < uiSourceCodeList.length; ++i) |
214 this.addUISourceCode(uiSourceCodeList[i]); | 214 this.addUISourceCode(uiSourceCodeList[i]); |
215 | 215 |
216 if (selected) | 216 if (selected) |
217 this.revealUISourceCode(uiSourceCodeList[0]); | 217 this.revealUISourceCode(uiSourceCodeList[0]); |
218 }, | 218 }, |
219 | 219 |
220 /** | 220 /** |
221 * @param {WebInspector.UISourceCode} uiSourceCode | 221 * @param {WebInspector.UISourceCode} uiSourceCode |
| 222 * @param {boolean} focusSource |
222 */ | 223 */ |
223 scriptSelected: function(uiSourceCode) | 224 _scriptSelected: function(uiSourceCode, focusSource) |
224 { | 225 { |
225 this._lastSelectedUISourceCode = uiSourceCode; | 226 this._lastSelectedUISourceCode = uiSourceCode; |
226 this.dispatchEventToListeners(WebInspector.ScriptsPanel.FileSelector.Eve
nts.FileSelected, uiSourceCode); | 227 this.dispatchEventToListeners(WebInspector.ScriptsPanel.FileSelector.Eve
nts.FileSelected, uiSourceCode); |
| 228 if (focusSource) |
| 229 this.dispatchEventToListeners(WebInspector.ScriptsPanel.FileSelector
.Events.ReleasedFocusAfterSelection, uiSourceCode); |
227 }, | 230 }, |
228 | 231 |
229 /** | 232 /** |
230 * @param {WebInspector.UISourceCode} uiSourceCode | 233 * @param {WebInspector.UISourceCode} uiSourceCode |
231 */ | 234 */ |
232 _removeUISourceCode: function(uiSourceCode) | 235 _removeUISourceCode: function(uiSourceCode) |
233 { | 236 { |
234 var treeElement = this._scriptTreeElementsByUISourceCode.get(uiSourceCod
e); | 237 var treeElement = this._scriptTreeElementsByUISourceCode.get(uiSourceCod
e); |
235 while (treeElement) { | 238 while (treeElement) { |
236 var parent = treeElement.parent; | 239 var parent = treeElement.parent; |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 { | 571 { |
569 return this._uiSourceCode; | 572 return this._uiSourceCode; |
570 }, | 573 }, |
571 | 574 |
572 onattach: function() | 575 onattach: function() |
573 { | 576 { |
574 WebInspector.BaseNavigatorTreeElement.prototype.onattach.call(this); | 577 WebInspector.BaseNavigatorTreeElement.prototype.onattach.call(this); |
575 this.listItemElement.addEventListener("click", this._onclick.bind(this),
false); | 578 this.listItemElement.addEventListener("click", this._onclick.bind(this),
false); |
576 }, | 579 }, |
577 | 580 |
| 581 onspace: function() |
| 582 { |
| 583 this._navigator._scriptSelected(this.uiSourceCode, true); |
| 584 return true; |
| 585 }, |
| 586 |
578 /** | 587 /** |
579 * @param {Event} event | 588 * @param {Event} event |
580 */ | 589 */ |
581 _onclick: function(event) | 590 _onclick: function(event) |
582 { | 591 { |
583 this._navigator.scriptSelected(this.uiSourceCode); | 592 this._navigator._scriptSelected(this.uiSourceCode, false); |
584 }, | 593 }, |
585 | 594 |
586 onenter: function() | 595 onenter: function() |
587 { | 596 { |
588 this._navigator.scriptSelected(this.uiSourceCode); | 597 this._navigator._scriptSelected(this.uiSourceCode, true); |
| 598 return true; |
589 } | 599 } |
590 } | 600 } |
591 | 601 |
592 WebInspector.NavigatorScriptTreeElement.prototype.__proto__ = WebInspector.BaseN
avigatorTreeElement.prototype; | 602 WebInspector.NavigatorScriptTreeElement.prototype.__proto__ = WebInspector.BaseN
avigatorTreeElement.prototype; |
OLD | NEW |