Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1364)

Unified Diff: Source/devtools/front_end/ui/TabbedPane.js

Issue 706523003: DevTools: Fix search view focusing on first opening (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ui/TabbedPane.js
diff --git a/Source/devtools/front_end/ui/TabbedPane.js b/Source/devtools/front_end/ui/TabbedPane.js
index 787bb7d3579afa675affd01dabc4abab5c3e84cf..80a0d0adaa421a26b21742c2ba4fc98414aa588c 100644
--- a/Source/devtools/front_end/ui/TabbedPane.js
+++ b/Source/devtools/front_end/ui/TabbedPane.js
@@ -1198,10 +1198,20 @@ WebInspector.ExtensibleTabbedPaneController.prototype = {
*/
_tabSelected: function(event)
{
- var tabId = this._tabbedPane.selectedTabId;
- if (!tabId)
- return;
- this.viewForId(tabId).then(this._tabbedPane.changeTabView.bind(this._tabbedPane, tabId)).done();
+ var tabId = /** @type {string} */ (event.data.tabId);
+ this.viewForId(tabId).then(viewLoaded.bind(this)).done();
+
+ /**
+ * @this {WebInspector.ExtensibleTabbedPaneController}
+ * @param {!WebInspector.View} view
+ */
+ function viewLoaded(view)
+ {
+ var shouldFocus = this._tabbedPane.visibleView.element.isSelfOrAncestor(WebInspector.currentFocusElement());
+ this._tabbedPane.changeTabView(tabId, view);
+ if (shouldFocus)
+ view.focus();
+ }
},
/**
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698