mirror of
https://github.com/hodgef/simple-keyboard.git
synced 2025-02-21 00:23:02 +08:00
Address handleButtonMouseDown TypeError. Fixes #844
This commit is contained in:
parent
fa213d1bd0
commit
df2889d416
@ -333,17 +333,19 @@ class SimpleKeyboard {
|
||||
*/
|
||||
/* istanbul ignore next */
|
||||
handleButtonMouseDown(button, e) {
|
||||
/**
|
||||
* Handle event options
|
||||
*/
|
||||
if (this.options.preventMouseDownDefault) e.preventDefault();
|
||||
if (this.options.stopMouseDownPropagation) e.stopPropagation();
|
||||
|
||||
/**
|
||||
* Add active class
|
||||
*/
|
||||
if (e) e.target.classList.add(this.activeButtonClass);
|
||||
if(e){
|
||||
/**
|
||||
* Handle event options
|
||||
*/
|
||||
if (this.options.preventMouseDownDefault) e.preventDefault();
|
||||
if (this.options.stopMouseDownPropagation) e.stopPropagation();
|
||||
|
||||
/**
|
||||
* Add active class
|
||||
*/
|
||||
e.target.classList.add(this.activeButtonClass);
|
||||
}
|
||||
|
||||
if (this.holdInteractionTimeout) clearTimeout(this.holdInteractionTimeout);
|
||||
if (this.holdTimeout) clearTimeout(this.holdTimeout);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user