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

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

Issue 1397403003: [DevTools] Remove HelpScreen, turn SettingsScreen into dialog and web component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@screens
Patch Set: Created 5 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/ui/Dialog.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js b/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js
index a93c4b00b24f2d0d460c79830e4c38957995bd9a..f54ae7a2a10b4d917e9e9c7cd21fd9d7d4f1f7de 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/Dialog.js
@@ -53,18 +53,19 @@ WebInspector.Dialog = function()
*/
WebInspector.Dialog.hasInstance = function()
{
- return !!WebInspector.Dialog._instance;
+ return !!WebInspector.Dialog._instances.length;
}
+/** @type {!Array<!WebInspector.Dialog>} */
+WebInspector.Dialog._instances = [];
+
WebInspector.Dialog.prototype = {
/**
* @override
*/
show: function()
{
- if (WebInspector.Dialog._instance)
- WebInspector.Dialog._instance.detach();
- WebInspector.Dialog._instance = this;
+ WebInspector.Dialog._instances.push(this);
this._glassPane = new WebInspector.GlassPane(/** @type {!Document} */ (WebInspector.Dialog._modalHostView.element.ownerDocument), this._dimmed);
this._glassPane.element.addEventListener("click", this._onGlassPaneClick.bind(this), false);
@@ -87,7 +88,8 @@ WebInspector.Dialog.prototype = {
this._glassPane.dispose();
delete this._glassPane;
- delete WebInspector.Dialog._instance;
+ console.assert(this === WebInspector.Dialog._instances.peekLast());
yurys 2015/10/13 00:52:11 How can you be sure that the dialogs are not close
dgozman 2015/10/13 01:57:42 They are stacked on top of each other. The alterna
+ WebInspector.Dialog._instances.pop();
},
addCloseButton: function()
@@ -224,7 +226,7 @@ WebInspector.Dialog.modalHostView = function()
WebInspector.Dialog.modalHostRepositioned = function()
{
- if (WebInspector.Dialog._instance)
- WebInspector.Dialog._instance._position();
+ for (var index = 0; index < WebInspector.Dialog._instances.length; ++index)
+ WebInspector.Dialog._instances[index]._position();
};

Powered by Google App Engine
This is Rietveld 408576698