mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-16 05:38:41 -09:00
minor syntax cleanup (2 vs 4 spaces) and clear clickTimer timeout
This commit is contained in:
parent
50fdbf2ef7
commit
33e3d487a1
1 changed files with 12 additions and 13 deletions
|
|
@ -402,27 +402,26 @@ export default class HyperTerm extends Component {
|
||||||
this.clicks = this.clicks || 1;
|
this.clicks = this.clicks || 1;
|
||||||
|
|
||||||
if (this.clicks++ >= 2) {
|
if (this.clicks++ >= 2) {
|
||||||
if (this.maximized) {
|
if (this.maximized) {
|
||||||
this.rpc.emit('unmaximize');
|
this.rpc.emit('unmaximize');
|
||||||
} else {
|
} else {
|
||||||
this.rpc.emit('maximize');
|
this.rpc.emit('maximize');
|
||||||
}
|
}
|
||||||
this.clicks = 0;
|
this.clicks = 0;
|
||||||
this.maximized = !this.maximized;
|
this.maximized = !this.maximized;
|
||||||
} else {
|
} else {
|
||||||
// http://www.quirksmode.org/dom/events/click.html
|
// http://www.quirksmode.org/dom/events/click.html
|
||||||
// https://en.wikipedia.org/wiki/Double-click
|
// https://en.wikipedia.org/wiki/Double-click
|
||||||
this.clickTimer = setTimeout(() => this.clicks = 0, 500);
|
this.clickTimer = setTimeout(() => this.clicks = 0, 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount () {
|
componentWillUnmount () {
|
||||||
this.rpc.destroy();
|
this.rpc.destroy();
|
||||||
clearTimeout(this.resizeIndicatorTimeout);
|
clearTimeout(this.resizeIndicatorTimeout);
|
||||||
if (this.keys) {
|
if (this.keys) this.keys.reset();
|
||||||
this.keys.reset();
|
|
||||||
}
|
|
||||||
delete this.clicks;
|
delete this.clicks;
|
||||||
|
clearTimeout(this.clickTimer);
|
||||||
this.updateChecker.destroy();
|
this.updateChecker.destroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue