| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 }, | 67 }, |
| 68 | 68 |
| 69 _constrainHeight: function(height) | 69 _constrainHeight: function(height) |
| 70 { | 70 { |
| 71 return Number.constrain(height, Preferences.minConsoleHeight, window.inn
erHeight - this._mainElement.totalOffsetTop() - Preferences.minConsoleHeight); | 71 return Number.constrain(height, Preferences.minConsoleHeight, window.inn
erHeight - this._mainElement.totalOffsetTop() - Preferences.minConsoleHeight); |
| 72 }, | 72 }, |
| 73 | 73 |
| 74 show: function(view, animationType) | 74 show: function(view, animationType) |
| 75 { | 75 { |
| 76 this.immediatelyFinishAnimation(); | 76 this.immediatelyFinishAnimation(); |
| 77 if (this._view && this._view.counterElement) |
| 78 this._view.counterElement.parentNode.removeChild(this._view.counterE
lement); |
| 77 | 79 |
| 78 var drawerWasVisible = this.visible; | 80 var drawerWasVisible = this.visible; |
| 79 | 81 |
| 80 if (this._view) { | 82 if (this._view) { |
| 81 this._drawerContentsElement.removeChildren(); | 83 this._drawerContentsElement.removeChildren(); |
| 82 this._view.hide(); | 84 this._view.hide(); |
| 83 } | 85 } |
| 84 | 86 |
| 85 this._view = view; | 87 this._view = view; |
| 86 | 88 |
| 87 var statusBarItems = this._view.statusBarItems || []; | 89 var statusBarItems = this._view.statusBarItems || []; |
| 88 this._viewStatusBar.removeChildren(); | 90 this._viewStatusBar.removeChildren(); |
| 89 for (var i = 0; i < statusBarItems.length; ++i) | 91 for (var i = 0; i < statusBarItems.length; ++i) |
| 90 this._viewStatusBar.appendChild(statusBarItems[i]); | 92 this._viewStatusBar.appendChild(statusBarItems[i]); |
| 91 | 93 |
| 94 if (this._view.counterElement) |
| 95 this._counters.insertBefore(this._view.counterElement, this._counter
s.firstChild); |
| 96 |
| 92 document.body.addStyleClass("drawer-visible"); | 97 document.body.addStyleClass("drawer-visible"); |
| 93 this._view.show(this._drawerContentsElement); | 98 this._view.show(this._drawerContentsElement); |
| 94 | 99 |
| 95 if (drawerWasVisible) | 100 if (drawerWasVisible) |
| 96 return; | 101 return; |
| 97 | 102 |
| 98 var anchoredItems = document.getElementById("anchored-status-bar-items")
; | 103 var anchoredItems = document.getElementById("anchored-status-bar-items")
; |
| 99 var height = this._constrainHeight(this._savedHeight || this.element.off
setHeight); | 104 var height = this._constrainHeight(this._savedHeight || this.element.off
setHeight); |
| 100 var animations = [ | 105 var animations = [ |
| 101 {element: this.element, end: {height: height}}, | 106 {element: this.element, end: {height: height}}, |
| 102 {element: this._mainElement, end: {bottom: height}}, | 107 {element: this._mainElement, end: {bottom: height}}, |
| 103 {element: this._mainStatusBar, start: {"padding-left": anchoredItems
.offsetWidth - 1}, end: {"padding-left": 0}}, | 108 {element: this._mainStatusBar, start: {"padding-left": anchoredItems
.offsetWidth - 1}, end: {"padding-left": 0}}, |
| 104 {element: this._viewStatusBar, start: {opacity: 0}, end: {opacity: 1
}} | 109 {element: this._viewStatusBar, start: {opacity: 0}, end: {opacity: 1
}} |
| 105 ]; | 110 ]; |
| 106 | 111 |
| 107 this._drawerStatusBar.insertBefore(anchoredItems, this._drawerStatusBar.
firstChild); | 112 this._drawerStatusBar.insertBefore(anchoredItems, this._drawerStatusBar.
firstChild); |
| 108 | 113 |
| 109 if (this._currentPanelCounters) { | 114 if (this._currentPanelCounters) { |
| 110 var oldRight = this._drawerStatusBar.clientWidth - (this._counters.o
ffsetLeft + this._currentPanelCounters.offsetWidth); | 115 var oldRight = this._drawerStatusBar.clientWidth - (this._counters.o
ffsetLeft + this._currentPanelCounters.offsetWidth); |
| 111 var newRight = WebInspector.Panel.counterRightMargin; | 116 var newRight = WebInspector.Panel.counterRightMargin; |
| 112 var rightPadding = (oldRight - newRight); | 117 var rightPadding = (oldRight - newRight); |
| 113 animations.push({element: this._currentPanelCounters, start: {"paddi
ng-right": rightPadding}, end: {"padding-right": 0}}); | 118 animations.push({element: this._currentPanelCounters, start: {"paddi
ng-right": rightPadding}, end: {"padding-right": 0}}); |
| 114 this._currentPanelCounters.parentNode.removeChild(this._currentPanel
Counters); | 119 this._currentPanelCounters.parentNode.removeChild(this._currentPanel
Counters); |
| 115 this._mainStatusBar.appendChild(this._currentPanelCounters); | 120 this._mainStatusBar.appendChild(this._currentPanelCounters); |
| 116 } | 121 } |
| 117 | 122 |
| 118 function animationFinished() | 123 function animationFinished() |
| 119 { | 124 { |
| 120 WebInspector.currentPanel().statusBarResized(); | 125 WebInspector.currentPanel().statusBarResized(); |
| 121 if (this._view && this._view.afterShow) | 126 if (this._view && this._view.afterShow) |
| 122 this._view.afterShow(); | 127 this._view.afterShow(); |
| 123 delete this._currentAnimation; | 128 delete this._currentAnimation; |
| 124 if (this._currentPanelCounters) | 129 if (this._currentPanelCounters) |
| 125 this._currentPanelCounters.removeAttribute("style"); | 130 this._currentPanelCounters.removeAttribute("style"); |
| 126 } | 131 } |
| 127 | 132 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 var rightPadding = (newRight - oldRight); | 167 var rightPadding = (newRight - oldRight); |
| 163 animations.push({element: this._currentPanelCounters, start: {"paddi
ng-right": 0}, end: {"padding-right": rightPadding}}); | 168 animations.push({element: this._currentPanelCounters, start: {"paddi
ng-right": 0}, end: {"padding-right": rightPadding}}); |
| 164 } | 169 } |
| 165 | 170 |
| 166 function animationFinished() | 171 function animationFinished() |
| 167 { | 172 { |
| 168 WebInspector.currentPanel().doResize(); | 173 WebInspector.currentPanel().doResize(); |
| 169 this._mainStatusBar.insertBefore(anchoredItems, this._mainStatusBar.
firstChild); | 174 this._mainStatusBar.insertBefore(anchoredItems, this._mainStatusBar.
firstChild); |
| 170 this._mainStatusBar.style.removeProperty("padding-left"); | 175 this._mainStatusBar.style.removeProperty("padding-left"); |
| 171 | 176 |
| 177 if (this._view.counterElement) |
| 178 this._view.counterElement.parentNode.removeChild(this._view.coun
terElement); |
| 179 |
| 172 if (this._currentPanelCounters) { | 180 if (this._currentPanelCounters) { |
| 173 this._currentPanelCounters.setAttribute("style", null); | 181 this._currentPanelCounters.setAttribute("style", null); |
| 174 this._currentPanelCounters.parentNode.removeChild(this._currentP
anelCounters); | 182 this._currentPanelCounters.parentNode.removeChild(this._currentP
anelCounters); |
| 175 this._counters.insertBefore(this._currentPanelCounters, this._co
unters.firstChild); | 183 this._counters.insertBefore(this._currentPanelCounters, this._co
unters.firstChild); |
| 176 } | 184 } |
| 177 | 185 |
| 178 this._view.hide(); | 186 this._view.hide(); |
| 179 this._drawerContentsElement.removeChildren(); | 187 this._drawerContentsElement.removeChildren(); |
| 180 delete this._view; | 188 delete this._view; |
| 181 document.body.removeStyleClass("drawer-visible"); | 189 document.body.removeStyleClass("drawer-visible"); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 delete this._statusBarDragOffset; | 277 delete this._statusBarDragOffset; |
| 270 | 278 |
| 271 event.stopPropagation(); | 279 event.stopPropagation(); |
| 272 } | 280 } |
| 273 } | 281 } |
| 274 | 282 |
| 275 /** | 283 /** |
| 276 * @type {WebInspector.Drawer} | 284 * @type {WebInspector.Drawer} |
| 277 */ | 285 */ |
| 278 WebInspector.drawer = null; | 286 WebInspector.drawer = null; |
| OLD | NEW |