| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 this.element.classList.add("panel"); | 40 this.element.classList.add("panel"); |
| 41 this.element.setAttribute("aria-label", name); | 41 this.element.setAttribute("aria-label", name); |
| 42 this.element.classList.add(name); | 42 this.element.classList.add(name); |
| 43 this._panelName = name; | 43 this._panelName = name; |
| 44 | 44 |
| 45 // For testing. | 45 // For testing. |
| 46 WebInspector.panels[name] = this; | 46 WebInspector.panels[name] = this; |
| 47 | 47 |
| 48 this._shortcuts = /** !Object.<number, function(Event=):boolean> */ ({}); | 48 this._shortcuts = /** !Object.<number, function(Event=):boolean> */ ({}); |
| 49 } | 49 }; |
| 50 | 50 |
| 51 // Should by in sync with style declarations. | 51 // Should by in sync with style declarations. |
| 52 WebInspector.Panel.counterRightMargin = 25; | 52 WebInspector.Panel.counterRightMargin = 25; |
| 53 | 53 |
| 54 WebInspector.Panel.prototype = { | 54 WebInspector.Panel.prototype = { |
| 55 get name() | 55 get name() |
| 56 { | 56 { |
| 57 return this._panelName; | 57 return this._panelName; |
| 58 }, | 58 }, |
| 59 | 59 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 /** | 112 /** |
| 113 * @param {!WebInspector.Infobar} infobar | 113 * @param {!WebInspector.Infobar} infobar |
| 114 */ | 114 */ |
| 115 _onInfobarClosed: function(infobar) | 115 _onInfobarClosed: function(infobar) |
| 116 { | 116 { |
| 117 infobar.element.remove(); | 117 infobar.element.remove(); |
| 118 this.doResize(); | 118 this.doResize(); |
| 119 }, | 119 }, |
| 120 | 120 |
| 121 __proto__: WebInspector.VBox.prototype | 121 __proto__: WebInspector.VBox.prototype |
| 122 } | 122 }; |
| 123 | 123 |
| 124 /** | 124 /** |
| 125 * @extends {WebInspector.Panel} | 125 * @extends {WebInspector.Panel} |
| 126 * @param {string} name | 126 * @param {string} name |
| 127 * @param {number=} defaultWidth | 127 * @param {number=} defaultWidth |
| 128 * @constructor | 128 * @constructor |
| 129 */ | 129 */ |
| 130 WebInspector.PanelWithSidebar = function(name, defaultWidth) | 130 WebInspector.PanelWithSidebar = function(name, defaultWidth) |
| 131 { | 131 { |
| 132 WebInspector.Panel.call(this, name); | 132 WebInspector.Panel.call(this, name); |
| 133 | 133 |
| 134 this._panelSplitWidget = new WebInspector.SplitWidget(true, false, this._pan
elName + "PanelSplitViewState", defaultWidth || 200); | 134 this._panelSplitWidget = new WebInspector.SplitWidget(true, false, this._pan
elName + "PanelSplitViewState", defaultWidth || 200); |
| 135 this._panelSplitWidget.show(this.element); | 135 this._panelSplitWidget.show(this.element); |
| 136 | 136 |
| 137 this._mainWidget = new WebInspector.VBox(); | 137 this._mainWidget = new WebInspector.VBox(); |
| 138 this._panelSplitWidget.setMainWidget(this._mainWidget); | 138 this._panelSplitWidget.setMainWidget(this._mainWidget); |
| 139 | 139 |
| 140 this._sidebarWidget = new WebInspector.VBox(); | 140 this._sidebarWidget = new WebInspector.VBox(); |
| 141 this._sidebarWidget.setMinimumSize(100, 25); | 141 this._sidebarWidget.setMinimumSize(100, 25); |
| 142 this._panelSplitWidget.setSidebarWidget(this._sidebarWidget); | 142 this._panelSplitWidget.setSidebarWidget(this._sidebarWidget); |
| 143 | 143 |
| 144 this._sidebarWidget.element.classList.add("panel-sidebar"); | 144 this._sidebarWidget.element.classList.add("panel-sidebar"); |
| 145 } | 145 }; |
| 146 | 146 |
| 147 WebInspector.PanelWithSidebar.prototype = { | 147 WebInspector.PanelWithSidebar.prototype = { |
| 148 /** | 148 /** |
| 149 * @return {!Element} | 149 * @return {!Element} |
| 150 */ | 150 */ |
| 151 panelSidebarElement: function() | 151 panelSidebarElement: function() |
| 152 { | 152 { |
| 153 return this._sidebarWidget.element; | 153 return this._sidebarWidget.element; |
| 154 }, | 154 }, |
| 155 | 155 |
| 156 /** | 156 /** |
| 157 * @return {!Element} | 157 * @return {!Element} |
| 158 */ | 158 */ |
| 159 mainElement: function() | 159 mainElement: function() |
| 160 { | 160 { |
| 161 return this._mainWidget.element; | 161 return this._mainWidget.element; |
| 162 }, | 162 }, |
| 163 | 163 |
| 164 /** | 164 /** |
| 165 * @return {!WebInspector.SplitWidget} | 165 * @return {!WebInspector.SplitWidget} |
| 166 */ | 166 */ |
| 167 splitWidget: function() | 167 splitWidget: function() |
| 168 { | 168 { |
| 169 return this._panelSplitWidget; | 169 return this._panelSplitWidget; |
| 170 }, | 170 }, |
| 171 | 171 |
| 172 __proto__: WebInspector.Panel.prototype | 172 __proto__: WebInspector.Panel.prototype |
| 173 } | 173 }; |
| OLD | NEW |