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