From 875b0ad88042555ab6fbb3ddf6d5161b58db3077 Mon Sep 17 00:00:00 2001 From: Dan Delany Date: Fri, 24 Oct 2014 14:39:37 -0400 Subject: [PATCH] fix issue with button zdepth not being reset correctly --- docs/dist/js/paper-button.jsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/dist/js/paper-button.jsx b/docs/dist/js/paper-button.jsx index 1ee906108834aa..32703b9e8714cd 100644 --- a/docs/dist/js/paper-button.jsx +++ b/docs/dist/js/paper-button.jsx @@ -49,7 +49,8 @@ var PaperButton = React.createClass({ }, getInitialState: function() { - return { zDepth: this.props.disabled ? 0 : zDepths[this.props.type] } + var zDepth = this.props.disabled ? 0 : zDepths[this.props.type]; + return { zDepth: zDepth, initialZDepth: zDepth }; }, render: function() { @@ -87,7 +88,6 @@ var PaperButton = React.createClass({ var $el = $(this.getDOMNode()), $ripple = $(this.refs.ripple.getDOMNode()), $offset = $el.offset(), - originalZDepth = this.state.zDepth, x = e.pageX - $offset.left, y = e.pageY - $offset.top; @@ -103,9 +103,9 @@ var PaperButton = React.createClass({ //animate the zdepth change if (this.props.type !== Types.FLAT) { - this.setState({ zDepth: originalZDepth + 1 }); + this.setState({ zDepth: this.state.initialZDepth + 1 }); CssEvent.onTransitionEnd($el, function() { - this.setState({ zDepth: originalZDepth }); + this.setState({ zDepth: this.state.initialZDepth }); }.bind(this)); } }