OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
61 } | 61 } |
62 | 62 |
63 WebInspector.Drawer.prototype = { | 63 WebInspector.Drawer.prototype = { |
64 /** | 64 /** |
65 * @param {string} id | 65 * @param {string} id |
66 * @param {boolean=} immediate | 66 * @param {boolean=} immediate |
67 * @return {!Promise.<?WebInspector.Widget>} | 67 * @return {!Promise.<?WebInspector.Widget>} |
68 */ | 68 */ |
69 showView: function(id, immediate) | 69 showView: function(id, immediate) |
70 { | 70 { |
71 /** | |
72 * @param {?WebInspector.Widget} view | |
73 * @return {?WebInspector.Widget} view | |
74 * @this {WebInspector.Drawer} | |
75 */ | |
76 function tabViewLoaded(view) | |
77 { | |
78 this.focus(); | |
dgozman
2016/05/31 19:30:42
I think you can call |this.focus()| right after |_
luoe
2016/05/31 21:22:54
This would cover most cases, but there is one case
| |
79 return view; | |
80 } | |
81 | |
71 this._innerShow(immediate); | 82 this._innerShow(immediate); |
72 WebInspector.userMetrics.drawerShown(id); | 83 WebInspector.userMetrics.drawerShown(id); |
73 return this._extensibleTabbedPaneController.showTab(id); | 84 return this._extensibleTabbedPaneController.showTab(id).then(tabViewLoad ed.bind(this)); |
74 }, | 85 }, |
75 | 86 |
76 showDrawer: function() | 87 showDrawer: function() |
77 { | 88 { |
78 this._innerShow(); | 89 this._innerShow(); |
79 }, | 90 }, |
80 | 91 |
81 wasShown: function() | 92 wasShown: function() |
82 { | 93 { |
83 var id = this._lastSelectedViewSetting.get(); | 94 var id = this._lastSelectedViewSetting.get(); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 return this._tabbedPane.selectedTabId; | 159 return this._tabbedPane.selectedTabId; |
149 }, | 160 }, |
150 | 161 |
151 initialPanelShown: function() | 162 initialPanelShown: function() |
152 { | 163 { |
153 this._initialPanelWasShown = true; | 164 this._initialPanelWasShown = true; |
154 }, | 165 }, |
155 | 166 |
156 __proto__: WebInspector.VBox.prototype | 167 __proto__: WebInspector.VBox.prototype |
157 } | 168 } |
OLD | NEW |