electron-react-titlebar
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -199,4 +199,21 @@ 'use strict'; | ||
this.onButtonClick = i => { | ||
if (this.lock) { | ||
this.lock = false; | ||
return; | ||
} | ||
console.log('click', i); | ||
this.setState({ | ||
clicked: !(this.state.focusing === i && this.state.clicked), | ||
clicked: !(this.state.focusing === i && this.state.clicked) | ||
}); | ||
}; | ||
this.onTouchStart = i => { | ||
if (i !== this.state.focusing) { | ||
this.lock = true; | ||
} | ||
}; | ||
this.onMouseMove = i => { | ||
if (i === this.state.focusing) return; | ||
this.setState({ | ||
focusing: i | ||
@@ -251,2 +268,4 @@ }); | ||
onClick: e => this.onButtonClick(i), | ||
onTouchStart: e => this.onTouchStart(i), | ||
onMouseMove: e => this.onMouseMove(i), | ||
ref: ref => this.setRefs(ref, i), | ||
@@ -253,0 +272,0 @@ className: (0, _classnames2.default)('toolbar-dropdown', { |
{ | ||
"name": "electron-react-titlebar", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "A github desktop style title bar component for electron.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -160,4 +160,19 @@ import React, { PureComponent } from 'react' | ||
onButtonClick = (i) => { | ||
if (this.lock) { | ||
this.lock = false | ||
return | ||
} | ||
console.log('click', i) | ||
this.setState({ | ||
clicked: !(this.state.focusing === i && this.state.clicked), | ||
}) | ||
} | ||
onTouchStart = (i) => { | ||
if (i !== this.state.focusing) { | ||
this.lock = true | ||
} | ||
} | ||
onMouseMove = (i) => { | ||
if (i === this.state.focusing) return | ||
this.setState({ | ||
focusing: i, | ||
@@ -200,2 +215,4 @@ }) | ||
onClick={e => this.onButtonClick(i)} | ||
onTouchStart={e => this.onTouchStart(i)} | ||
onMouseMove={e => this.onMouseMove(i)} | ||
ref={ref => this.setRefs(ref, i)} | ||
@@ -202,0 +219,0 @@ className={classnames('toolbar-dropdown', { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49765
1318