| 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 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 }, | 104 }, |
| 105 | 105 |
| 106 /** | 106 /** |
| 107 * @param {string} dockSide | 107 * @param {string} dockSide |
| 108 */ | 108 */ |
| 109 _dockSideChanged: function(dockSide) | 109 _dockSideChanged: function(dockSide) |
| 110 { | 110 { |
| 111 if (this._dockSide === dockSide) | 111 if (this._dockSide === dockSide) |
| 112 return; | 112 return; |
| 113 | 113 |
| 114 this.dispatchEventToListeners(WebInspector.DockController.Events.BeforeD
ockSideChanged, dockSide); | 114 var eventData = { from: this._dockSide, to: dockSide }; |
| 115 InspectorFrontendHost.setIsDocked(dockSide !== WebInspector.DockControll
er.State.Undocked, this._setIsDockedResponse.bind(this)); | 115 this.dispatchEventToListeners(WebInspector.DockController.Events.BeforeD
ockSideChanged, eventData); |
| 116 InspectorFrontendHost.setIsDocked(dockSide !== WebInspector.DockControll
er.State.Undocked, this._setIsDockedResponse.bind(this, eventData)); |
| 116 this._dockSide = dockSide; | 117 this._dockSide = dockSide; |
| 117 this._updateUI(); | 118 this._updateUI(); |
| 118 this.dispatchEventToListeners(WebInspector.DockController.Events.DockSid
eChanged, this._dockSide); | 119 this.dispatchEventToListeners(WebInspector.DockController.Events.DockSid
eChanged, eventData); |
| 119 }, | 120 }, |
| 120 | 121 |
| 121 _setIsDockedResponse: function() | 122 /** |
| 123 * @param {{from: string, to: string}} eventData |
| 124 */ |
| 125 _setIsDockedResponse: function(eventData) |
| 122 { | 126 { |
| 123 this.dispatchEventToListeners(WebInspector.DockController.Events.AfterDo
ckSideChanged, this._dockSide); | 127 this.dispatchEventToListeners(WebInspector.DockController.Events.AfterDo
ckSideChanged, eventData); |
| 124 }, | 128 }, |
| 125 | 129 |
| 126 _updateUI: function() | 130 _updateUI: function() |
| 127 { | 131 { |
| 128 var body = document.body; | 132 var body = document.body; |
| 129 switch (this._dockSide) { | 133 switch (this._dockSide) { |
| 130 case WebInspector.DockController.State.DockedToBottom: | 134 case WebInspector.DockController.State.DockedToBottom: |
| 131 body.classList.remove("undocked"); | 135 body.classList.remove("undocked"); |
| 132 body.classList.remove("dock-to-right"); | 136 body.classList.remove("dock-to-right"); |
| 133 body.classList.remove("dock-to-left"); | 137 body.classList.remove("dock-to-left"); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 WebInspector.dockController._dockSideChanged.bind(WebInspect
or.dockController)); | 189 WebInspector.dockController._dockSideChanged.bind(WebInspect
or.dockController)); |
| 186 } | 190 } |
| 187 return this._dockToggleButton; | 191 return this._dockToggleButton; |
| 188 } | 192 } |
| 189 } | 193 } |
| 190 | 194 |
| 191 /** | 195 /** |
| 192 * @type {!WebInspector.DockController} | 196 * @type {!WebInspector.DockController} |
| 193 */ | 197 */ |
| 194 WebInspector.dockController; | 198 WebInspector.dockController; |
| OLD | NEW |