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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 this._constraintsInDip = !!constraintsInDip; | 60 this._constraintsInDip = !!constraintsInDip; |
61 this._setting = settingName ? WebInspector.settings.createSetting(settingNam
e, {}) : null; | 61 this._setting = settingName ? WebInspector.settings.createSetting(settingNam
e, {}) : null; |
62 | 62 |
63 this.setSecondIsSidebar(secondIsSidebar); | 63 this.setSecondIsSidebar(secondIsSidebar); |
64 | 64 |
65 this._innerSetVertical(isVertical); | 65 this._innerSetVertical(isVertical); |
66 this._showMode = WebInspector.SplitWidget.ShowMode.Both; | 66 this._showMode = WebInspector.SplitWidget.ShowMode.Both; |
67 | 67 |
68 // Should be called after isVertical has the right value. | 68 // Should be called after isVertical has the right value. |
69 this.installResizer(this._resizerElement); | 69 this.installResizer(this._resizerElement); |
70 } | 70 }; |
71 | 71 |
72 /** @typedef {{showMode: string, size: number}} */ | 72 /** @typedef {{showMode: string, size: number}} */ |
73 WebInspector.SplitWidget.SettingForOrientation; | 73 WebInspector.SplitWidget.SettingForOrientation; |
74 | 74 |
75 WebInspector.SplitWidget.ShowMode = { | 75 WebInspector.SplitWidget.ShowMode = { |
76 Both: "Both", | 76 Both: "Both", |
77 OnlyMain: "OnlyMain", | 77 OnlyMain: "OnlyMain", |
78 OnlySidebar: "OnlySidebar" | 78 OnlySidebar: "OnlySidebar" |
79 } | 79 }; |
80 | 80 |
81 /** @enum {symbol} */ | 81 /** @enum {symbol} */ |
82 WebInspector.SplitWidget.Events = { | 82 WebInspector.SplitWidget.Events = { |
83 SidebarSizeChanged: Symbol("SidebarSizeChanged"), | 83 SidebarSizeChanged: Symbol("SidebarSizeChanged"), |
84 ShowModeChanged: Symbol("ShowModeChanged") | 84 ShowModeChanged: Symbol("ShowModeChanged") |
85 } | 85 }; |
86 | 86 |
87 WebInspector.SplitWidget.MinPadding = 20; | 87 WebInspector.SplitWidget.MinPadding = 20; |
88 | 88 |
89 WebInspector.SplitWidget.prototype = { | 89 WebInspector.SplitWidget.prototype = { |
90 /** | 90 /** |
91 * @return {boolean} | 91 * @return {boolean} |
92 */ | 92 */ |
93 isVertical: function() | 93 isVertical: function() |
94 { | 94 { |
95 return this._isVertical; | 95 return this._isVertical; |
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
911 { | 911 { |
912 if (!this._showHideSidebarButton) | 912 if (!this._showHideSidebarButton) |
913 return; | 913 return; |
914 var sidebarHidden = this._showMode === WebInspector.SplitWidget.ShowMode
.OnlyMain; | 914 var sidebarHidden = this._showMode === WebInspector.SplitWidget.ShowMode
.OnlyMain; |
915 var side = this.isVertical() ? (this.isSidebarSecond() ? "right" : "left
") : (this.isSidebarSecond() ? "bottom" : "top"); | 915 var side = this.isVertical() ? (this.isSidebarSecond() ? "right" : "left
") : (this.isSidebarSecond() ? "bottom" : "top"); |
916 this._showHideSidebarButton.setState(side + "-" + (sidebarHidden ? "show
" : "hide")); | 916 this._showHideSidebarButton.setState(side + "-" + (sidebarHidden ? "show
" : "hide")); |
917 this._showHideSidebarButton.setTitle(sidebarHidden ? WebInspector.UIStri
ng("Show %s", this._showHideSidebarButtonTitle) : WebInspector.UIString("Hide %s
", this._showHideSidebarButtonTitle)); | 917 this._showHideSidebarButton.setTitle(sidebarHidden ? WebInspector.UIStri
ng("Show %s", this._showHideSidebarButtonTitle) : WebInspector.UIString("Hide %s
", this._showHideSidebarButtonTitle)); |
918 }, | 918 }, |
919 | 919 |
920 __proto__: WebInspector.Widget.prototype | 920 __proto__: WebInspector.Widget.prototype |
921 } | 921 }; |
OLD | NEW |