Skip to content

Commit

Permalink
Remove ripples from menus in doc site, button ripples should occur on…
Browse files Browse the repository at this point in the history
… mouse down - Fixes #19, #21, and #22
  • Loading branch information
jtollerene committed Nov 10, 2014
1 parent 434a3e1 commit a6b810a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions docs/dist/js/menu-item.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var MenuItem = React.createClass({
if (this.props.toggle) toggle = <Toggle onToggle={this._onToggleClick} />;

return (
<div key={this.props.index} className={classes} onClick={this._onClick}>
<div key={this.props.index} className={classes} onMouseDown={this._onClick}>
<Ripple ref="ripple" />
{icon}
{this.props.children}
Expand All @@ -77,9 +77,9 @@ var MenuItem = React.createClass({
var _this = this;

//animate the ripple
this.refs.ripple.animate(e, function() {
// this.refs.ripple.animate(e, function() {
if (_this.props.onClick) _this.props.onClick(e, _this.props.index);
});
// });
},

_onToggleClick: function(e, toggled) {
Expand Down
8 changes: 6 additions & 2 deletions docs/dist/js/paper-button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ var PaperButton = React.createClass({
if (this.props.icon) icon = <Icon className="mui-paper-button-icon" icon={this.props.icon} />;

return (
<Paper className={classes} zDepth={this.state.zDepth} circle={circle} onClick={this._onClick}>
<Paper className={classes} zDepth={this.state.zDepth} circle={circle}
onClick={this._onClick} onMouseDown={this._onMouseDown}>
<Ripple ref="ripple" />
<a href={this.props.href} className="mui-paper-button-content">
{this.props.label}
Expand All @@ -79,9 +80,12 @@ var PaperButton = React.createClass({
);
},

_onMouseDown: function(e) {
if (!this.props.disabled) this._animateButtonClick(e);
},

_onClick: function(e) {
if (!this.props.disabled) {
this._animateButtonClick(e);
if (this.props.onClick) this.props.onClick(e);
}
},
Expand Down

0 comments on commit a6b810a

Please sign in to comment.