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

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

Issue 2460513003: DevTools: [Persistence] tabs should not change order during reload (Closed)
Patch Set: fix test Created 4 years, 2 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 15877233783a531da09f964d801c18d4b5138ac2..872798171c43677ae40110f32a0de801714cadc2 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/TabbedEditorContainer.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/TabbedEditorContainer.js
@@ -101,9 +101,11 @@ WebInspector.TabbedEditorContainer.prototype = {
var currentScrollLineNumber = this._history.scrollLineNumber(binding.fileSystem.url());
var tabIndex = this._tabbedPane.tabIndex(fileSystemTabId);
- this._closeTabs([fileSystemTabId], true);
- if (!networkTabId)
- networkTabId = this._appendFileTab(binding.network, false, tabIndex);
+ var tabsToClose = [fileSystemTabId];
+ if (networkTabId)
+ tabsToClose.push(networkTabId);
+ this._closeTabs(tabsToClose, true);
+ networkTabId = this._appendFileTab(binding.network, false, tabIndex);
this._updateHistory();
if (wasSelectedInFileSystem)
@@ -122,10 +124,14 @@ WebInspector.TabbedEditorContainer.prototype = {
var networkTabId = this._tabIds.get(binding.network);
if (!networkTabId)
return;
-
- var fileSystemTabId = this._appendFileTab(binding.fileSystem, false);
+ var tabIndex = this._tabbedPane.tabIndex(networkTabId);
+ var wasSelected = this._currentFile === binding.network;
+ var fileSystemTabId = this._appendFileTab(binding.fileSystem, false, tabIndex);
this._updateHistory();
+ if (wasSelected)
+ this._tabbedPane.selectTab(fileSystemTabId, false);
+
var fileSystemTabView = /** @type {!WebInspector.Widget} */(this._tabbedPane.tabView(fileSystemTabId));
var savedSelectionRange = this._history.selectionRange(binding.network.url());
var savedScrollLineNumber = this._history.scrollLineNumber(binding.network.url());

Powered by Google App Engine
This is Rietveld 408576698