Skip to content

Commit

Permalink
Add a property which disables swipe-to-open feature of left nav
Browse files Browse the repository at this point in the history
Resolves mui#1222
  • Loading branch information
pomerantsev committed Jul 28, 2015
1 parent 6f8cda4 commit a9d6f23
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/left-nav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ let LeftNav = React.createClass({
onNavClose: React.PropTypes.func,
openRight: React.PropTypes.bool,
selectedIndex: React.PropTypes.number,
disableSwipeToOpen: React.PropTypes.bool
},

windowListeners: {
Expand All @@ -39,6 +40,7 @@ let LeftNav = React.createClass({
getDefaultProps() {
return {
docked: true,
disableSwipeToOpen: false
};
},

Expand Down Expand Up @@ -238,7 +240,10 @@ let LeftNav = React.createClass({
},

_onBodyTouchStart(e) {
if (!this.state.open && openNavEventHandler !== this._onBodyTouchStart) {
if (!this.state.open &&
(openNavEventHandler !== this._onBodyTouchStart ||
this.props.disableSwipeToOpen)
) {
return;
}

Expand Down

0 comments on commit a9d6f23

Please sign in to comment.