Skip to content

Commit

Permalink
feat: allow quick connecting by double clicking
Browse files Browse the repository at this point in the history
  • Loading branch information
luin committed Nov 20, 2016
1 parent f5f5df9 commit 53a284e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions client/components/main/Main/ConnectionSelector/Favorite.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class Favorite extends React.Component {
select(favorite, connect) {
const activeKey = favorite ? favorite.get('key') : null;
this.setState({ activeKey });
if (connect && activeKey) {
if (connect) {
this.props.onRequireConnecting(activeKey);
} else {
this.props.onSelect(activeKey);
Expand All @@ -70,7 +70,11 @@ class Favorite extends React.Component {
return <div style={ { flex: 1, display: 'flex', flexDirection: 'column', overflowY: 'hidden' } }>
<nav className="nav-group">
<h5 className="nav-group-title"></h5>
<a className={'nav-group-item' + (this.state.activeKey ? '' : ' active')} onClick={this.onClick.bind(this, -1)}>
<a
className={'nav-group-item' + (this.state.activeKey ? '' : ' active')}
onClick={this.onClick.bind(this, -1)}
onDoubleClick={this.onDoubleClick.bind(this, -1)}
>
<span className="icon icon-flash"></span>
QUICK CONNECT
</a>
Expand Down

0 comments on commit 53a284e

Please sign in to comment.