mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-20 16:22:56 +02:00
change modals so they close on mouse down outside the box
This commit is contained in:
@@ -36,6 +36,7 @@ interface ICreateElementLabelOptions {
|
||||
interface ICreateElementListenerOptions {
|
||||
changeListener?(this: HTMLElement, ev: Event): any;
|
||||
clickListener?(this: HTMLElement, ev: MouseEvent): any;
|
||||
mouseDown?(this: HTMLElement, ev: MouseEvent): any;
|
||||
inputListener?(this: HTMLElement, ev: Event): any;
|
||||
onfocus?(this: HTMLElement, ev: FocusEvent): any;
|
||||
onkeydown?(this: HTMLElement, ev: KeyboardEvent): any;
|
||||
@@ -158,6 +159,9 @@ function setElementListeners(el: HTMLElement, params: ICreateElementListenerOpti
|
||||
if (params.clickListener !== undefined) {
|
||||
el.addEventListener("click", params.clickListener);
|
||||
}
|
||||
if (params.mouseDown !== undefined) {
|
||||
el.addEventListener("mousedown", params.mouseDown);
|
||||
}
|
||||
if (params.inputListener !== undefined) {
|
||||
el.addEventListener("input", params.inputListener);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user