-
- // Temporarily set properties and classes to mimic the post-animation values so panels
- // like Elements in their updateStatusBarItems call will size things to fit the final location.
- document.body.classList.remove("drawer-visible");
- this._inspectorView.currentPanel().statusBarResized();
- document.body.classList.add("drawer-visible");
-
- var animations = [
- {element: this.element, start: {"flex-basis": this.element.offsetHeight }, end: {"flex-basis": 23}},
- ];
-
- /**
- * @param {boolean} finished
- * @this {WebInspector.Drawer}
- */
- function animationCallback(finished)
- {
- var panel = this._inspectorView.currentPanel();
- if (!finished) {
- panel.doResize();
- return;
- }
- this._tabbedPane.detach();
- this._drawerContentsElement.removeChildren();
- document.body.classList.remove("drawer-visible");
- panel.doResize();
- delete this._currentAnimation;
- delete this._isHiding;
- }
-
- this._currentAnimation = WebInspector.animateStyle(animations, this._animationDuration(immediately), animationCallback.bind(this));
-
- if (immediately)
- this._currentAnimation.forceComplete();
- },
-
- resize: function()
- {
- if (!this._toggleDrawerButton.toggled)
- return;
-
- this._visibleView().storeScrollPositions();
- var height = this._constrainHeight(this.element.offsetHeight);
- this.element.style.flexBasis = height + "px";
- this._tabbedPane.doResize();
- },
-
- _immediatelyFinishAnimation: function()
- {
- if (this._currentAnimation)
- this._currentAnimation.forceComplete();
- },
-
- /**
- * @param {boolean=} immediately
- * @return {number}
- */
- _animationDuration: function(immediately)
- {
- return immediately ? 0 : 50;
- },
-
- /**
- * @return {boolean}
- */
- _startStatusBarDragging: function(event)
- {
- if (!this._toggleDrawerButton.toggled || event.target !== this._tabbedPane.headerElement())
- return false;
-
- this._visibleView().storeScrollPositions();
- this._statusBarDragOffset = event.pageY - this.element.totalOffsetTop();
- return true;
- },
-
- _statusBarDragging: function(event)
- {
- var height = window.innerHeight - event.pageY + this._statusBarDragOffset;
- height = Number.constrain(height, Preferences.minConsoleHeight, this._inspectorView.devtoolsElement().offsetHeight - Preferences.minConsoleHeight);
-
- this.element.style.flexBasis = height + "px";
- if (this._inspectorView.currentPanel())
- this._inspectorView.currentPanel().doResize();
- this._tabbedPane.doResize();
-
- event.consume(true);
- },
-
- _endStatusBarDragging: function(event)
- {
- this._savedHeight = this.element.offsetHeight;
- delete this._statusBarDragOffset;
-
- event.consume();