| 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 * 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 * | 10 * |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 this._sidebarElement.style.removeProperty("height"); | 143 this._sidebarElement.style.removeProperty("height"); |
| 144 | 144 |
| 145 this._innerSetSidebarSizeDIP(this._preferredSidebarSizeDIP(), !!animate)
; | 145 this._innerSetSidebarSizeDIP(this._preferredSidebarSizeDIP(), !!animate)
; |
| 146 }, | 146 }, |
| 147 | 147 |
| 148 /** | 148 /** |
| 149 * @param {!WebInspector.Widget} widget | 149 * @param {!WebInspector.Widget} widget |
| 150 */ | 150 */ |
| 151 setMainWidget: function(widget) | 151 setMainWidget: function(widget) |
| 152 { | 152 { |
| 153 if (this._mainWidget === widget) |
| 154 return; |
| 153 if (this._mainWidget) | 155 if (this._mainWidget) |
| 154 this._mainWidget.detach(); | 156 this._mainWidget.detach(); |
| 155 this._mainWidget = widget; | 157 this._mainWidget = widget; |
| 156 if (widget) { | 158 if (widget) { |
| 157 widget.element.classList.add("insertion-point-main"); | 159 widget.element.classList.add("insertion-point-main"); |
| 158 widget.element.classList.remove("insertion-point-sidebar"); | 160 widget.element.classList.remove("insertion-point-sidebar"); |
| 159 if (this._showMode === WebInspector.SplitWidget.ShowMode.OnlyMain ||
this._showMode === WebInspector.SplitWidget.ShowMode.Both) | 161 if (this._showMode === WebInspector.SplitWidget.ShowMode.OnlyMain ||
this._showMode === WebInspector.SplitWidget.ShowMode.Both) |
| 160 widget.show(this.element); | 162 widget.show(this.element); |
| 161 } | 163 } |
| 162 }, | 164 }, |
| 163 | 165 |
| 164 /** | 166 /** |
| 165 * @param {!WebInspector.Widget} widget | 167 * @param {!WebInspector.Widget} widget |
| 166 */ | 168 */ |
| 167 setSidebarWidget: function(widget) | 169 setSidebarWidget: function(widget) |
| 168 { | 170 { |
| 171 if (this._sidebarWidget === widget) |
| 172 return; |
| 169 if (this._sidebarWidget) | 173 if (this._sidebarWidget) |
| 170 this._sidebarWidget.detach(); | 174 this._sidebarWidget.detach(); |
| 171 this._sidebarWidget = widget; | 175 this._sidebarWidget = widget; |
| 172 if (widget) { | 176 if (widget) { |
| 173 widget.element.classList.add("insertion-point-sidebar"); | 177 widget.element.classList.add("insertion-point-sidebar"); |
| 174 widget.element.classList.remove("insertion-point-main"); | 178 widget.element.classList.remove("insertion-point-main"); |
| 175 if (this._showMode === WebInspector.SplitWidget.ShowMode.OnlySidebar
|| this._showMode === WebInspector.SplitWidget.ShowMode.Both) | 179 if (this._showMode === WebInspector.SplitWidget.ShowMode.OnlySidebar
|| this._showMode === WebInspector.SplitWidget.ShowMode.Both) |
| 176 widget.show(this.element); | 180 widget.show(this.element); |
| 177 } | 181 } |
| 178 }, | 182 }, |
| (...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 901 this._showHideSidebarButton.classList.toggle("toggled-hide", !sidebarHid
den); | 905 this._showHideSidebarButton.classList.toggle("toggled-hide", !sidebarHid
den); |
| 902 this._showHideSidebarButton.classList.toggle("top-sidebar-show-hide-butt
on", !this.isVertical() && !this.isSidebarSecond()); | 906 this._showHideSidebarButton.classList.toggle("top-sidebar-show-hide-butt
on", !this.isVertical() && !this.isSidebarSecond()); |
| 903 this._showHideSidebarButton.classList.toggle("right-sidebar-show-hide-bu
tton", this.isVertical() && this.isSidebarSecond()); | 907 this._showHideSidebarButton.classList.toggle("right-sidebar-show-hide-bu
tton", this.isVertical() && this.isSidebarSecond()); |
| 904 this._showHideSidebarButton.classList.toggle("bottom-sidebar-show-hide-b
utton", !this.isVertical() && this.isSidebarSecond()); | 908 this._showHideSidebarButton.classList.toggle("bottom-sidebar-show-hide-b
utton", !this.isVertical() && this.isSidebarSecond()); |
| 905 this._showHideSidebarButton.classList.toggle("left-sidebar-show-hide-but
ton", this.isVertical() && !this.isSidebarSecond()); | 909 this._showHideSidebarButton.classList.toggle("left-sidebar-show-hide-but
ton", this.isVertical() && !this.isSidebarSecond()); |
| 906 this._showHideSidebarButton.title = sidebarHidden ? WebInspector.UIStrin
g("Show %s", this._showHideSidebarButtonTitle) : WebInspector.UIString("Hide %s"
, this._showHideSidebarButtonTitle); | 910 this._showHideSidebarButton.title = sidebarHidden ? WebInspector.UIStrin
g("Show %s", this._showHideSidebarButtonTitle) : WebInspector.UIString("Hide %s"
, this._showHideSidebarButtonTitle); |
| 907 }, | 911 }, |
| 908 | 912 |
| 909 __proto__: WebInspector.Widget.prototype | 913 __proto__: WebInspector.Widget.prototype |
| 910 } | 914 } |
| OLD | NEW |