mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-16 06:18:42 +02:00
popup now all can be dismissed by clicking outside the window and have grey background
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
width: 70%;
|
||||
max-height: 80%;
|
||||
overflow-y: auto;
|
||||
z-index: 11; /* Sit on top of the container */
|
||||
color: var(--my-font-color);
|
||||
}
|
||||
|
||||
|
||||
2
dist/engine.bundle.js
vendored
2
dist/engine.bundle.js
vendored
File diff suppressed because one or more lines are too long
2
dist/engineStyle.css
vendored
2
dist/engineStyle.css
vendored
@@ -1552,6 +1552,8 @@ button {
|
||||
width: 70%;
|
||||
max-height: 80%;
|
||||
overflow-y: auto;
|
||||
z-index: 11;
|
||||
/* Sit on top of the container */
|
||||
color: var(--my-font-color); }
|
||||
|
||||
.popup-box-button,
|
||||
|
||||
@@ -33,12 +33,17 @@ export function createPopup<T>(id: string, rootComponent: (props: T) => React.Re
|
||||
let container = document.getElementById(id);
|
||||
if (container == null) {
|
||||
function onClick(this: HTMLElement, event: MouseEvent): any {
|
||||
//console.log(this.id);
|
||||
if(!event.srcElement) return;
|
||||
if(!(event.srcElement instanceof HTMLElement)) return;
|
||||
const clickedId = (event.srcElement as HTMLElement).id;
|
||||
if(clickedId !== id) return;
|
||||
removePopup(id);
|
||||
}
|
||||
container = createElement("div", {
|
||||
class: "popup-box-container",
|
||||
display: "flex",
|
||||
id: id,
|
||||
backgroundColor: 'rgba(0,0,0,0.5)',
|
||||
clickListener: onClick,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user