Chromium Code Reviews| 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(); |
| }; |