mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-21 16:52:55 +02:00
+9
-4
@@ -1,7 +1,11 @@
|
||||
/* Pop up Dialog Box */
|
||||
/**
|
||||
* Create and display a pop-up dialog box.
|
||||
* This dialog box does not allow for any interaction and should close when clicking
|
||||
* outside of it
|
||||
*/
|
||||
let dialogBoxes = [];
|
||||
|
||||
//Close dialog box when clicking outside
|
||||
// Close dialog box when clicking outside
|
||||
$(document).click(function(event) {
|
||||
if (dialogBoxOpened && dialogBoxes.length >= 1) {
|
||||
if (!$(event.target).closest(dialogBoxes[0]).length){
|
||||
@@ -17,7 +21,7 @@ $(document).click(function(event) {
|
||||
});
|
||||
|
||||
|
||||
//Dialog box close buttons
|
||||
// Dialog box close buttons
|
||||
$(document).on('click', '.dialog-box-close-button', function( event ) {
|
||||
if (dialogBoxOpened && dialogBoxes.length >= 1) {
|
||||
dialogBoxes[0].remove();
|
||||
@@ -30,9 +34,10 @@ $(document).on('click', '.dialog-box-close-button', function( event ) {
|
||||
}
|
||||
});
|
||||
|
||||
var dialogBoxOpened = false;
|
||||
let dialogBoxOpened = false;
|
||||
|
||||
function dialogBoxCreate(txt, preformatted=false) {
|
||||
console.log(`dialogBoxCreate() called`)
|
||||
var container = document.createElement("div");
|
||||
container.setAttribute("class", "dialog-box-container");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user