better click handling
This commit is contained in:
parent
523eb8c7f8
commit
62f03862d6
1 changed files with 16 additions and 4 deletions
|
@ -361,12 +361,24 @@ const Audio = function(tp, record) {
|
|||
mappingOptions.max_in = (bb.height - min_y) * y_factor;
|
||||
}
|
||||
});
|
||||
fft_Dom.addEventListener('mouseup', (e) => {
|
||||
const unset = (e) => {
|
||||
setFrequency = false;
|
||||
};
|
||||
const unsetFromOutside = (e) => {
|
||||
document.removeEventListener('mouseup', unsetFromOutside);
|
||||
unset(e);
|
||||
};
|
||||
fft_Dom.addEventListener('mouseup', unset);
|
||||
fft_Dom.addEventListener('mouseleave', (e) => {
|
||||
if (setFrequency) {
|
||||
document.addEventListener('mouseup', unsetFromOutside);
|
||||
}
|
||||
});
|
||||
fft_Dom.addEventListener('mouseenter', (e) => {
|
||||
if (setFrequency) {
|
||||
document.removeEventListener('mouseup', unsetFromOutside);
|
||||
}
|
||||
});
|
||||
//fft_Dom.addEventListener('mouseout', (e) => {
|
||||
//setFrequency = false;
|
||||
//});
|
||||
|
||||
container.after(audioOptions);
|
||||
|
||||
|
|
Loading…
Reference in a new issue