| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 The Chromium Authors. All rights reserved. | 2 * Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * @constructor | 8 * @constructor |
| 9 * @extends {WebInspector.DialogDelegate} | 9 * @extends {WebInspector.DialogDelegate} |
| 10 */ | 10 */ |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 | 45 |
| 46 /** @type {!Map.<string, string>} */ | 46 /** @type {!Map.<string, string>} */ |
| 47 this._entries = new Map(); | 47 this._entries = new Map(); |
| 48 var patterns = WebInspector.moduleSetting("skipStackFramesPattern").getAsArr
ay(); | 48 var patterns = WebInspector.moduleSetting("skipStackFramesPattern").getAsArr
ay(); |
| 49 for (var i = 0; i < patterns.length; ++i) | 49 for (var i = 0; i < patterns.length; ++i) |
| 50 this._addPattern(patterns[i].pattern, patterns[i].disabled); | 50 this._addPattern(patterns[i].pattern, patterns[i].disabled); |
| 51 | 51 |
| 52 this.element.tabIndex = 0; | 52 this.element.tabIndex = 0; |
| 53 } | 53 } |
| 54 | 54 |
| 55 WebInspector.FrameworkBlackboxDialog.show = function(element) | 55 WebInspector.FrameworkBlackboxDialog.show = function() |
| 56 { | 56 { |
| 57 var dialog = new WebInspector.FrameworkBlackboxDialog(); | 57 var dialog = new WebInspector.FrameworkBlackboxDialog(); |
| 58 WebInspector.Dialog.show(element, dialog); | 58 WebInspector.Dialog.show(dialog); |
| 59 var glassPane = dialog.element.ownerDocument.getElementById("glass-pane"); | 59 var glassPane = dialog.element.ownerDocument.getElementById("glass-pane"); |
| 60 glassPane.classList.add("settings-glass-pane"); | 60 glassPane.classList.add("settings-glass-pane"); |
| 61 } | 61 } |
| 62 | 62 |
| 63 WebInspector.FrameworkBlackboxDialog.prototype = { | 63 WebInspector.FrameworkBlackboxDialog.prototype = { |
| 64 /** | 64 /** |
| 65 * @override | 65 * @override |
| 66 * @param {!Element} element | 66 * @param {!Element} element |
| 67 */ | 67 */ |
| 68 show: function(element) | 68 show: function(element) |
| 69 { | 69 { |
| 70 this._dialogElement = element; | 70 this._dialogElement = element; |
| 71 element.appendChild(this.element); | 71 element.appendChild(this.element); |
| 72 element.classList.add("settings-dialog", "settings-tab"); | 72 element.classList.add("settings-dialog", "settings-tab"); |
| 73 }, | 73 }, |
| 74 | 74 |
| 75 _resize: function() | 75 _resize: function() |
| 76 { | 76 { |
| 77 if (!this._dialogElement || !this._relativeToElement) | 77 if (!this._dialogElement || !this._container) |
| 78 return; | 78 return; |
| 79 | 79 |
| 80 const minWidth = 200; | 80 const minWidth = 200; |
| 81 const minHeight = 150; | 81 const minHeight = 150; |
| 82 var maxHeight = this._relativeToElement.offsetHeight - 10; | 82 var maxHeight = this._container.offsetHeight - 10; |
| 83 maxHeight = Math.max(minHeight, maxHeight); | 83 maxHeight = Math.max(minHeight, maxHeight); |
| 84 var maxWidth = Math.min(540, this._relativeToElement.offsetWidth - 10); | 84 var maxWidth = Math.min(540, this._container.offsetWidth - 10); |
| 85 maxWidth = Math.max(minWidth, maxWidth); | 85 maxWidth = Math.max(minWidth, maxWidth); |
| 86 this._dialogElement.style.maxHeight = maxHeight + "px"; | 86 this._dialogElement.style.maxHeight = maxHeight + "px"; |
| 87 this._dialogElement.style.width = maxWidth + "px"; | 87 this._dialogElement.style.width = maxWidth + "px"; |
| 88 | 88 |
| 89 WebInspector.DialogDelegate.prototype.position(this._dialogElement, this
._relativeToElement); | 89 WebInspector.DialogDelegate.prototype.position(this._dialogElement, this
._container); |
| 90 }, | 90 }, |
| 91 | 91 |
| 92 /** | 92 /** |
| 93 * @override | 93 * @override |
| 94 * @param {!Element} element | 94 * @param {!Element} element |
| 95 * @param {!Element} relativeToElement | 95 * @param {!Element} container |
| 96 */ | 96 */ |
| 97 position: function(element, relativeToElement) | 97 position: function(element, container) |
| 98 { | 98 { |
| 99 this._relativeToElement = relativeToElement; | 99 this._container = container; |
| 100 this._resize(); | 100 this._resize(); |
| 101 }, | 101 }, |
| 102 | 102 |
| 103 willHide: function(event) | 103 willHide: function(event) |
| 104 { | 104 { |
| 105 }, | 105 }, |
| 106 | 106 |
| 107 /** | 107 /** |
| 108 * @param {string} itemId | 108 * @param {string} itemId |
| 109 * @param {string} columnId | 109 * @param {string} columnId |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 var nodeName = focusElement && focusElement.nodeName.toLowerCase(); | 231 var nodeName = focusElement && focusElement.nodeName.toLowerCase(); |
| 232 if (nodeName === "input" || nodeName === "select") { | 232 if (nodeName === "input" || nodeName === "select") { |
| 233 this.focus(); | 233 this.focus(); |
| 234 event.consume(true); | 234 event.consume(true); |
| 235 return; | 235 return; |
| 236 } | 236 } |
| 237 }, | 237 }, |
| 238 | 238 |
| 239 __proto__: WebInspector.DialogDelegate.prototype | 239 __proto__: WebInspector.DialogDelegate.prototype |
| 240 } | 240 } |
| OLD | NEW |