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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 setMainWidget: function(widget) | 151 setMainWidget: function(widget) |
152 { | 152 { |
153 if (this._mainWidget === widget) | 153 if (this._mainWidget === widget) |
154 return; | 154 return; |
155 if (this._mainWidget) | 155 if (this._mainWidget) |
156 this._mainWidget.detach(); | 156 this._mainWidget.detach(); |
157 this._mainWidget = widget; | 157 this._mainWidget = widget; |
158 if (widget) { | 158 if (widget) { |
159 widget.element.classList.add("insertion-point-main"); | 159 widget.element.classList.add("insertion-point-main"); |
160 widget.element.classList.remove("insertion-point-sidebar"); | 160 widget.element.classList.remove("insertion-point-sidebar"); |
| 161 widget.attach(this.element, this._sidebarWidget ? this._sidebarWidge
t.element : null); |
161 if (this._showMode === WebInspector.SplitWidget.ShowMode.OnlyMain ||
this._showMode === WebInspector.SplitWidget.ShowMode.Both) | 162 if (this._showMode === WebInspector.SplitWidget.ShowMode.OnlyMain ||
this._showMode === WebInspector.SplitWidget.ShowMode.Both) |
162 widget.show(this.element); | 163 widget.showWidget(); |
163 } | 164 } |
164 }, | 165 }, |
165 | 166 |
166 /** | 167 /** |
167 * @param {!WebInspector.Widget} widget | 168 * @param {!WebInspector.Widget} widget |
168 */ | 169 */ |
169 setSidebarWidget: function(widget) | 170 setSidebarWidget: function(widget) |
170 { | 171 { |
171 if (this._sidebarWidget === widget) | 172 if (this._sidebarWidget === widget) |
172 return; | 173 return; |
173 if (this._sidebarWidget) | 174 if (this._sidebarWidget) |
174 this._sidebarWidget.detach(); | 175 this._sidebarWidget.detach(); |
175 this._sidebarWidget = widget; | 176 this._sidebarWidget = widget; |
176 if (widget) { | 177 if (widget) { |
177 widget.element.classList.add("insertion-point-sidebar"); | 178 widget.element.classList.add("insertion-point-sidebar"); |
178 widget.element.classList.remove("insertion-point-main"); | 179 widget.element.classList.remove("insertion-point-main"); |
| 180 widget.attach(this.element); |
179 if (this._showMode === WebInspector.SplitWidget.ShowMode.OnlySidebar
|| this._showMode === WebInspector.SplitWidget.ShowMode.Both) | 181 if (this._showMode === WebInspector.SplitWidget.ShowMode.OnlySidebar
|| this._showMode === WebInspector.SplitWidget.ShowMode.Both) |
180 widget.show(this.element); | 182 widget.showWidget(); |
181 } | 183 } |
182 }, | 184 }, |
183 | 185 |
184 /** | 186 /** |
185 * @return {?WebInspector.Widget} | 187 * @return {?WebInspector.Widget} |
186 */ | 188 */ |
187 mainWidget: function() | 189 mainWidget: function() |
188 { | 190 { |
189 return this._mainWidget; | 191 return this._mainWidget; |
190 }, | 192 }, |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 this._cancelAnimation(); | 311 this._cancelAnimation(); |
310 | 312 |
311 /** | 313 /** |
312 * @this {WebInspector.SplitWidget} | 314 * @this {WebInspector.SplitWidget} |
313 */ | 315 */ |
314 function callback() | 316 function callback() |
315 { | 317 { |
316 if (sideToShow) { | 318 if (sideToShow) { |
317 // Make sure main is first in the children list. | 319 // Make sure main is first in the children list. |
318 if (sideToShow === this._mainWidget) | 320 if (sideToShow === this._mainWidget) |
319 this._mainWidget.show(this.element, this._sidebarWidget ? th
is._sidebarWidget.element : null); | 321 this._mainWidget.showWidget(); |
320 else | 322 else |
321 this._sidebarWidget.show(this.element); | 323 this._sidebarWidget.showWidget(); |
322 } | 324 } |
323 if (sideToHide) { | 325 if (sideToHide) { |
324 this._detaching = true; | 326 this._detaching = true; |
325 sideToHide.detach(); | 327 sideToHide.hideWidget(); |
326 delete this._detaching; | 328 delete this._detaching; |
327 } | 329 } |
328 | 330 |
329 this._resizerElement.classList.add("hidden"); | 331 this._resizerElement.classList.add("hidden"); |
330 shadowToShow.classList.remove("hidden"); | 332 shadowToShow.classList.remove("hidden"); |
331 shadowToShow.classList.add("maximized"); | 333 shadowToShow.classList.add("maximized"); |
332 shadowToHide.classList.add("hidden"); | 334 shadowToHide.classList.add("hidden"); |
333 shadowToHide.classList.remove("maximized"); | 335 shadowToHide.classList.remove("maximized"); |
334 this._removeAllLayoutProperties(); | 336 this._removeAllLayoutProperties(); |
335 this.doResize(); | 337 this.doResize(); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 animate = false; | 375 animate = false; |
374 | 376 |
375 this._cancelAnimation(); | 377 this._cancelAnimation(); |
376 this._mainElement.classList.remove("maximized", "hidden"); | 378 this._mainElement.classList.remove("maximized", "hidden"); |
377 this._sidebarElement.classList.remove("maximized", "hidden"); | 379 this._sidebarElement.classList.remove("maximized", "hidden"); |
378 this._resizerElement.classList.remove("hidden"); | 380 this._resizerElement.classList.remove("hidden"); |
379 this.setResizable(true); | 381 this.setResizable(true); |
380 | 382 |
381 // Make sure main is the first in the children list. | 383 // Make sure main is the first in the children list. |
382 if (this._sidebarWidget) | 384 if (this._sidebarWidget) |
383 this._sidebarWidget.show(this.element); | 385 this._sidebarWidget.showWidget(); |
384 if (this._mainWidget) | 386 if (this._mainWidget) |
385 this._mainWidget.show(this.element, this._sidebarWidget ? this._side
barWidget.element : null); | 387 this._mainWidget.showWidget(); |
386 // Order widgets in DOM properly. | 388 // Order widgets in DOM properly. |
387 this.setSecondIsSidebar(this._secondIsSidebar); | 389 this.setSecondIsSidebar(this._secondIsSidebar); |
388 | 390 |
389 this._sidebarSizeDIP = -1; | 391 this._sidebarSizeDIP = -1; |
390 this._updateShowMode(WebInspector.SplitWidget.ShowMode.Both); | 392 this._updateShowMode(WebInspector.SplitWidget.ShowMode.Both); |
391 this._updateLayout(animate); | 393 this._updateLayout(animate); |
392 }, | 394 }, |
393 | 395 |
394 /** | 396 /** |
395 * @param {boolean} resizable | 397 * @param {boolean} resizable |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 this._showHideSidebarButton.classList.toggle("toggled-hide", !sidebarHid
den); | 915 this._showHideSidebarButton.classList.toggle("toggled-hide", !sidebarHid
den); |
914 this._showHideSidebarButton.classList.toggle("top-sidebar-show-hide-butt
on", !this.isVertical() && !this.isSidebarSecond()); | 916 this._showHideSidebarButton.classList.toggle("top-sidebar-show-hide-butt
on", !this.isVertical() && !this.isSidebarSecond()); |
915 this._showHideSidebarButton.classList.toggle("right-sidebar-show-hide-bu
tton", this.isVertical() && this.isSidebarSecond()); | 917 this._showHideSidebarButton.classList.toggle("right-sidebar-show-hide-bu
tton", this.isVertical() && this.isSidebarSecond()); |
916 this._showHideSidebarButton.classList.toggle("bottom-sidebar-show-hide-b
utton", !this.isVertical() && this.isSidebarSecond()); | 918 this._showHideSidebarButton.classList.toggle("bottom-sidebar-show-hide-b
utton", !this.isVertical() && this.isSidebarSecond()); |
917 this._showHideSidebarButton.classList.toggle("left-sidebar-show-hide-but
ton", this.isVertical() && !this.isSidebarSecond()); | 919 this._showHideSidebarButton.classList.toggle("left-sidebar-show-hide-but
ton", this.isVertical() && !this.isSidebarSecond()); |
918 this._showHideSidebarButton.title = sidebarHidden ? WebInspector.UIStrin
g("Show %s", this._showHideSidebarButtonTitle) : WebInspector.UIString("Hide %s"
, this._showHideSidebarButtonTitle); | 920 this._showHideSidebarButton.title = sidebarHidden ? WebInspector.UIStrin
g("Show %s", this._showHideSidebarButtonTitle) : WebInspector.UIString("Hide %s"
, this._showHideSidebarButtonTitle); |
919 }, | 921 }, |
920 | 922 |
921 __proto__: WebInspector.Widget.prototype | 923 __proto__: WebInspector.Widget.prototype |
922 } | 924 } |
OLD | NEW |