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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/View.js

Issue 2867133002: DevTools: Let the drawer tabs be reordered (Closed)
Patch Set: Add test Created 3 years, 7 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/ui/View.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/View.js b/third_party/WebKit/Source/devtools/front_end/ui/View.js
index fb1b51ce9ef688c8fb8ebc6a43fd885bc22fcfb2..78d1828832fbaa7d4238175c7ffabf458f30b8c2 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/View.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/View.js
@@ -676,6 +676,15 @@ UI.ViewManager._TabbedLocation = class extends UI.ViewManager._Location {
this._tabbedPane.appendTab(
view.viewId(), view.title(), new UI.ViewManager._ContainerWidget(view), undefined, false,
view.isCloseable() || view.isTransient(), index);
+ if (view.isCloseable()) {
dgozman 2017/05/25 17:12:49 Let's move this persisting block to appendView ins
einbinder 2017/05/25 23:48:54 Done.
+ var tabs = this._closeableTabSetting.get();
+ var tabId = view.viewId();
+ if (!tabs[tabId]) {
+ tabs[tabId] = true;
+ this._closeableTabSetting.set(tabs);
+ }
+ }
+ this._persistTabOrder();
}
/**
@@ -748,17 +757,6 @@ UI.ViewManager._TabbedLocation = class extends UI.ViewManager._Location {
var tabId = /** @type {string} */ (event.data.tabId);
if (this._lastSelectedTabSetting && event.data['isUserGesture'])
this._lastSelectedTabSetting.set(tabId);
- var view = this._views.get(tabId);
- if (!view)
- return;
-
- if (view.isCloseable()) {
einbinder 2017/05/23 00:12:25 Tabs were persisted when they were selected, but i
- var tabs = this._closeableTabSetting.get();
- if (!tabs[tabId]) {
- tabs[tabId] = true;
- this._closeableTabSetting.set(tabs);
- }
- }
}
/**
@@ -773,10 +771,7 @@ UI.ViewManager._TabbedLocation = class extends UI.ViewManager._Location {
}
}
- /**
- * @param {!Common.Event} event
- */
- _persistTabOrder(event) {
+ _persistTabOrder() {
var tabIds = this._tabbedPane.tabIds();
var tabOrders = {};
for (var i = 0; i < tabIds.length; i++)

Powered by Google App Engine
This is Rietveld 408576698