| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 { | 66 { |
| 67 if (WebInspector.Dialog._instance) | 67 if (WebInspector.Dialog._instance) |
| 68 WebInspector.Dialog._instance.detach(); | 68 WebInspector.Dialog._instance.detach(); |
| 69 WebInspector.Dialog._instance = this; | 69 WebInspector.Dialog._instance = this; |
| 70 | 70 |
| 71 var document = /** @type {!Document} */ (WebInspector.Dialog._modalHostV
iew.element.ownerDocument); | 71 var document = /** @type {!Document} */ (WebInspector.Dialog._modalHostV
iew.element.ownerDocument); |
| 72 this._disableTabIndexOnElements(document); | 72 this._disableTabIndexOnElements(document); |
| 73 | 73 |
| 74 this._glassPane = new WebInspector.GlassPane(document, this._dimmed); | 74 this._glassPane = new WebInspector.GlassPane(document, this._dimmed); |
| 75 this._glassPane.element.addEventListener("click", this._onGlassPaneClick
.bind(this), false); | 75 this._glassPane.element.addEventListener("click", this._onGlassPaneClick
.bind(this), false); |
| 76 WebInspector.GlassPane.DefaultFocusedViewStack.push(this); |
| 76 | 77 |
| 77 WebInspector.Widget.prototype.show.call(this, this._glassPane.element); | 78 WebInspector.Widget.prototype.show.call(this, this._glassPane.element); |
| 78 | 79 |
| 79 this._position(); | 80 this._position(); |
| 80 this.focus(); | 81 this.focus(); |
| 81 }, | 82 }, |
| 82 | 83 |
| 83 /** | 84 /** |
| 84 * @override | 85 * @override |
| 85 */ | 86 */ |
| 86 detach: function() | 87 detach: function() |
| 87 { | 88 { |
| 88 var previousFocusElement = WebInspector.previousFocusElement(); | |
| 89 WebInspector.Widget.prototype.detach.call(this); | 89 WebInspector.Widget.prototype.detach.call(this); |
| 90 |
| 91 WebInspector.GlassPane.DefaultFocusedViewStack.pop(); |
| 90 this._glassPane.dispose(); | 92 this._glassPane.dispose(); |
| 91 delete this._glassPane; | 93 delete this._glassPane; |
| 92 | 94 |
| 93 if (previousFocusElement) | |
| 94 previousFocusElement.focus(); | |
| 95 this._restoreTabIndexOnElements(); | 95 this._restoreTabIndexOnElements(); |
| 96 | 96 |
| 97 delete WebInspector.Dialog._instance; | 97 delete WebInspector.Dialog._instance; |
| 98 }, | 98 }, |
| 99 | 99 |
| 100 addCloseButton: function() | 100 addCloseButton: function() |
| 101 { | 101 { |
| 102 var closeButton = this.contentElement.createChild("div", "dialog-close-b
utton", "dt-close-button"); | 102 var closeButton = this.contentElement.createChild("div", "dialog-close-b
utton", "dt-close-button"); |
| 103 closeButton.gray = true; | 103 closeButton.gray = true; |
| 104 closeButton.addEventListener("click", this.detach.bind(this, false), fal
se); | 104 closeButton.addEventListener("click", this.detach.bind(this, false), fal
se); |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 { | 251 { |
| 252 return WebInspector.Dialog._modalHostView; | 252 return WebInspector.Dialog._modalHostView; |
| 253 }; | 253 }; |
| 254 | 254 |
| 255 WebInspector.Dialog.modalHostRepositioned = function() | 255 WebInspector.Dialog.modalHostRepositioned = function() |
| 256 { | 256 { |
| 257 if (WebInspector.Dialog._instance) | 257 if (WebInspector.Dialog._instance) |
| 258 WebInspector.Dialog._instance._position(); | 258 WebInspector.Dialog._instance._position(); |
| 259 }; | 259 }; |
| 260 | 260 |
| OLD | NEW |