mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 23:08:36 +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%;
|
width: 70%;
|
||||||
max-height: 80%;
|
max-height: 80%;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
z-index: 11; /* Sit on top of the container */
|
||||||
color: var(--my-font-color);
|
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%;
|
width: 70%;
|
||||||
max-height: 80%;
|
max-height: 80%;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
z-index: 11;
|
||||||
|
/* Sit on top of the container */
|
||||||
color: var(--my-font-color); }
|
color: var(--my-font-color); }
|
||||||
|
|
||||||
.popup-box-button,
|
.popup-box-button,
|
||||||
|
|||||||
@@ -33,12 +33,17 @@ export function createPopup<T>(id: string, rootComponent: (props: T) => React.Re
|
|||||||
let container = document.getElementById(id);
|
let container = document.getElementById(id);
|
||||||
if (container == null) {
|
if (container == null) {
|
||||||
function onClick(this: HTMLElement, event: MouseEvent): any {
|
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", {
|
container = createElement("div", {
|
||||||
class: "popup-box-container",
|
class: "popup-box-container",
|
||||||
display: "flex",
|
display: "flex",
|
||||||
id: id,
|
id: id,
|
||||||
|
backgroundColor: 'rgba(0,0,0,0.5)',
|
||||||
clickListener: onClick,
|
clickListener: onClick,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user