mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-21 09:09:01 +00:00
bind and remove input function
This commit is contained in:
parent
da4b72c2d3
commit
d9dc12477c
1 changed files with 4 additions and 3 deletions
|
|
@ -44,6 +44,8 @@ class MilkdropWindow extends React.Component {
|
|||
"butterchurn"
|
||||
);
|
||||
|
||||
this._handleKeyboardInput = this._handleKeyboardInput.bind(this);
|
||||
|
||||
require.ensure(
|
||||
["butterchurn-presets"],
|
||||
require => {
|
||||
|
|
@ -54,9 +56,7 @@ class MilkdropWindow extends React.Component {
|
|||
this.cycleInterval = setInterval(() => {
|
||||
this._nextPreset(PRESET_TRANSITION_SECONDS);
|
||||
}, MILLISECONDS_BETWEEN_PRESET_TRANSITIONS);
|
||||
document.addEventListener("keydown", e => {
|
||||
this._handleKeyboardInput(e);
|
||||
});
|
||||
document.addEventListener("keydown", this._handleKeyboardInput);
|
||||
},
|
||||
e => {
|
||||
console.error("Error loading Butterchurn presets", e);
|
||||
|
|
@ -67,6 +67,7 @@ class MilkdropWindow extends React.Component {
|
|||
componentWillUnmount() {
|
||||
this._pauseViz();
|
||||
this._stopCycling();
|
||||
document.removeEventListener("keydown", this._handleKeyboardInput);
|
||||
}
|
||||
componentDidUpdate(prevProps) {
|
||||
if (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue