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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/TabbedEditorContainer.js

Issue 2740053002: DevTools: keep selected tab as persistence binding comes in (Closed)
Patch Set: thoughtful code Created 3 years, 9 months 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
Index: third_party/WebKit/Source/devtools/front_end/sources/TabbedEditorContainer.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/TabbedEditorContainer.js b/third_party/WebKit/Source/devtools/front_end/sources/TabbedEditorContainer.js
index 1410bfe8e381ad0b3b500df67ff83bc2c63fda28..af1160fb2cd19c202d050c754339b2f9a0ff02b1 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/TabbedEditorContainer.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/TabbedEditorContainer.js
@@ -91,19 +91,18 @@ Sources.TabbedEditorContainer = class extends Common.Object {
if (!networkTabId)
return;
- var tabIndex = this._tabbedPane.tabIndex(networkTabId);
- var tabsToClose = [networkTabId];
- if (fileSystemTabId)
- tabsToClose.push(fileSystemTabId);
- this._closeTabs(tabsToClose, true);
- fileSystemTabId = this._appendFileTab(binding.fileSystem, false, tabIndex);
- this._updateHistory();
+ if (!fileSystemTabId) {
dgozman 2017/03/10 19:23:38 Do we have to move filsystem in place of network o
+ var tabIndex = this._tabbedPane.tabIndex(networkTabId);
+ fileSystemTabId = this._appendFileTab(binding.fileSystem, false, tabIndex);
+ var fileSystemTabView = /** @type {!UI.Widget} */ (this._tabbedPane.tabView(fileSystemTabId));
+ this._restoreEditorProperties(fileSystemTabView, currentSelectionRange, currentScrollLineNumber);
+ }
+ this._closeTabs([networkTabId], true);
if (wasSelectedInNetwork)
this._tabbedPane.selectTab(fileSystemTabId, false);
- var fileSystemTabView = /** @type {!UI.Widget} */ (this._tabbedPane.tabView(fileSystemTabId));
- this._restoreEditorProperties(fileSystemTabView, currentSelectionRange, currentScrollLineNumber);
+ this._updateHistory();
}
/**
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/inspector/persistence/persistence-tabbed-editor-keeps-selected-tab-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698