diff --git a/bower.json b/bower.json index 5b6c3f9..ad2cd35 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "router5-react", - "version": "0.1.2", + "version": "0.1.3", "homepage": "http://router5.github.io", "authors": [ "Thomas Roch " diff --git a/dist/amd/link-factory.js b/dist/amd/link-factory.js index 0b85e1f..b8ad6d0 100644 --- a/dist/amd/link-factory.js +++ b/dist/amd/link-factory.js @@ -42,7 +42,7 @@ define(['exports', 'module', 'react'], function (exports, module, _react) { }, clickHandler: function clickHandler(evt) { - if (evt.nativeEvent.which === 1) { + if (!evt.nativeEvent.which === 2) { evt.preventDefault(); router.navigate(this.props.routeName, this.props.routeParams, this.props.routeOptions); } diff --git a/dist/browser/router5-react.js b/dist/browser/router5-react.js index 22574d1..e461732 100644 --- a/dist/browser/router5-react.js +++ b/dist/browser/router5-react.js @@ -60,7 +60,7 @@ function linkFactory(router) { }, clickHandler: function clickHandler(evt) { - if (evt.nativeEvent.which === 1) { + if (!evt.nativeEvent.which === 2) { evt.preventDefault(); router.navigate(this.props.routeName, this.props.routeParams, this.props.routeOptions); } diff --git a/dist/browser/router5-react.min.js b/dist/browser/router5-react.min.js index 62b4f15..6313404 100644 --- a/dist/browser/router5-react.min.js +++ b/dist/browser/router5-react.min.js @@ -22,4 +22,4 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -(function(){"use strict";function t(t){return React.createClass({propTypes:{routeName:React.PropTypes.string.isRequired,routeParams:React.PropTypes.object,routeOptions:React.PropTypes.object,activeClassName:React.PropTypes.string,activeStrict:React.PropTypes.bool,onClick:React.PropTypes.func},getDefaultProps:function e(){return{activeClassName:"active",activeStrict:false,routeParams:{},routeOptions:{}}},getInitialState:function r(){return{active:t.isActive(this.props.routeName,this.props.routeParams,this.props.activeStrict)}},shouldComponentUpdate:function n(e,r){return!t.areStatesEqual({name:e.routeName,params:e.routeParams},{name:this.props.routeName,params:this.props.routeParams})||this.state.active!==r.active},clickHandler:function a(e){if(e.nativeEvent.which===1){e.preventDefault();t.navigate(this.props.routeName,this.props.routeParams,this.props.routeOptions)}},routeChangeHandler:function i(e,r){this.setState({active:t.isActive(this.props.routeName,this.props.routeParams)})},componentDidMount:function o(){t.addListener(this.routeChangeHandler)},componentWillUnmount:function s(){t.removeListener(this.routeChangeHandler)},render:function c(){var e=this.props;var r=this.state.active;var n=t.buildUrl(e.routeName,e.routeParams);var a=(e.className?e.className.split(" "):[]).concat(r?[e.activeClassName]:[]).join(" ");var i=e.onClick||this.clickHandler;return React.createElement("a",{href:n,className:a,onClick:i},e.children)}})}function e(t){return function(e,r){return{nodeListener:function n(t,e){r.call(this,t,e)},componentDidMount:function a(){if(r)t.addNodeListener(e,this.nodeListener);t.registerComponent(e,this)},componentWillUnmount:function i(){if(r)t.removeNodeListener(e,this.nodeListener);t.deregisterComponent(e,this)}}}}window.linkFactory=t;window.segmentMixinFactory=e})(); \ No newline at end of file +(function(){"use strict";function t(t){return React.createClass({propTypes:{routeName:React.PropTypes.string.isRequired,routeParams:React.PropTypes.object,routeOptions:React.PropTypes.object,activeClassName:React.PropTypes.string,activeStrict:React.PropTypes.bool,onClick:React.PropTypes.func},getDefaultProps:function e(){return{activeClassName:"active",activeStrict:false,routeParams:{},routeOptions:{}}},getInitialState:function r(){return{active:t.isActive(this.props.routeName,this.props.routeParams,this.props.activeStrict)}},shouldComponentUpdate:function n(e,r){return!t.areStatesEqual({name:e.routeName,params:e.routeParams},{name:this.props.routeName,params:this.props.routeParams})||this.state.active!==r.active},clickHandler:function a(e){if(!e.nativeEvent.which===2){e.preventDefault();t.navigate(this.props.routeName,this.props.routeParams,this.props.routeOptions)}},routeChangeHandler:function i(e,r){this.setState({active:t.isActive(this.props.routeName,this.props.routeParams)})},componentDidMount:function o(){t.addListener(this.routeChangeHandler)},componentWillUnmount:function s(){t.removeListener(this.routeChangeHandler)},render:function c(){var e=this.props;var r=this.state.active;var n=t.buildUrl(e.routeName,e.routeParams);var a=(e.className?e.className.split(" "):[]).concat(r?[e.activeClassName]:[]).join(" ");var i=e.onClick||this.clickHandler;return React.createElement("a",{href:n,className:a,onClick:i},e.children)}})}function e(t){return function(e,r){return{nodeListener:function n(t,e){r.call(this,t,e)},componentDidMount:function a(){if(r)t.addNodeListener(e,this.nodeListener);t.registerComponent(e,this)},componentWillUnmount:function i(){if(r)t.removeNodeListener(e,this.nodeListener);t.deregisterComponent(e,this)}}}}window.linkFactory=t;window.segmentMixinFactory=e})(); \ No newline at end of file diff --git a/dist/commonjs/link-factory.js b/dist/commonjs/link-factory.js index 85dd9a9..5862fa8 100644 --- a/dist/commonjs/link-factory.js +++ b/dist/commonjs/link-factory.js @@ -47,7 +47,7 @@ function linkFactory(router) { }, clickHandler: function clickHandler(evt) { - if (evt.nativeEvent.which === 1) { + if (!evt.nativeEvent.which === 2) { evt.preventDefault(); router.navigate(this.props.routeName, this.props.routeParams, this.props.routeOptions); } diff --git a/package.json b/package.json index 9f653d0..6c37177 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "router5-react", - "version": "0.1.2", + "version": "0.1.3", "description": "router5 helpers for React", "main": "dist/commonjs/index.js", "scripts": {