mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 08:45:12 +02:00
change load modal
This commit is contained in:
parent
b80cb976f9
commit
b18878148c
@ -1886,11 +1886,31 @@ function load_modal(settings) {
|
|||||||
data.append("page", settings.onshow.page);
|
data.append("page", settings.onshow.page);
|
||||||
data.append("method", settings.onshow.method);
|
data.append("method", settings.onshow.method);
|
||||||
|
|
||||||
|
if (settings.target == undefined) {
|
||||||
|
var uniq = uniqId();
|
||||||
|
var div = document.createElement("div");
|
||||||
|
div.id = "div-modal-" + uniq;
|
||||||
|
div.style.display = "none";
|
||||||
|
|
||||||
|
document.getElementById("main").append(div);
|
||||||
|
|
||||||
|
var id_modal_target = "#div-modal-" + uniq;
|
||||||
|
|
||||||
|
settings.target = $(id_modal_target);
|
||||||
|
}
|
||||||
|
|
||||||
var width = 630;
|
var width = 630;
|
||||||
if (settings.onshow.width) {
|
if (settings.onshow.width) {
|
||||||
width = settings.onshow.width;
|
width = settings.onshow.width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (settings.modal.overlay == undefined) {
|
||||||
|
settings.modal.overlay = {
|
||||||
|
opacity: 0.5,
|
||||||
|
background: "black"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
settings.target.html("Loading modal...");
|
settings.target.html("Loading modal...");
|
||||||
settings.target
|
settings.target
|
||||||
.dialog({
|
.dialog({
|
||||||
@ -2081,14 +2101,16 @@ function load_modal(settings) {
|
|||||||
modal: true,
|
modal: true,
|
||||||
title: settings.modal.title,
|
title: settings.modal.title,
|
||||||
width: width,
|
width: width,
|
||||||
overlay: {
|
overlay: settings.modal.overlay,
|
||||||
opacity: 0.5,
|
|
||||||
background: "black"
|
|
||||||
},
|
|
||||||
buttons: required_buttons,
|
buttons: required_buttons,
|
||||||
closeOnEscape: false,
|
closeOnEscape: false,
|
||||||
open: function() {
|
open: function() {
|
||||||
$(".ui-dialog-titlebar-close").hide();
|
$(".ui-dialog-titlebar-close").hide();
|
||||||
|
},
|
||||||
|
close: function() {
|
||||||
|
if (id_modal_target != undefined) {
|
||||||
|
$(id_modal_target).remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -2100,13 +2122,7 @@ function load_modal(settings) {
|
|||||||
|
|
||||||
//Function that shows a dialog box to confirm closures of generic manners. The modal id is random
|
//Function that shows a dialog box to confirm closures of generic manners. The modal id is random
|
||||||
function confirmDialog(settings) {
|
function confirmDialog(settings) {
|
||||||
var randomStr =
|
var randomStr = uniqId();
|
||||||
Math.random()
|
|
||||||
.toString(36)
|
|
||||||
.substring(2, 15) +
|
|
||||||
Math.random()
|
|
||||||
.toString(36)
|
|
||||||
.substring(2, 15);
|
|
||||||
|
|
||||||
$("body").append(
|
$("body").append(
|
||||||
'<div id="confirm_' + randomStr + '">' + settings.message + "</div>"
|
'<div id="confirm_' + randomStr + '">' + settings.message + "</div>"
|
||||||
@ -2142,6 +2158,18 @@ function confirmDialog(settings) {
|
|||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function uniqId() {
|
||||||
|
var randomStr =
|
||||||
|
Math.random()
|
||||||
|
.toString(36)
|
||||||
|
.substring(2, 15) +
|
||||||
|
Math.random()
|
||||||
|
.toString(36)
|
||||||
|
.substring(2, 15);
|
||||||
|
|
||||||
|
return randomStr;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to show modal with message Validation.
|
* Function to show modal with message Validation.
|
||||||
*
|
*
|
||||||
|
@ -29,3 +29,32 @@ li > input[type="text"] {
|
|||||||
.margin_button {
|
.margin_button {
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.container-target {
|
||||||
|
display: flex;
|
||||||
|
flex-flow: row wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.element-target {
|
||||||
|
width: 20px;
|
||||||
|
margin: 2px;
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-normal {
|
||||||
|
background-color: #add570;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-critical {
|
||||||
|
background-color: #e3485e;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-notinit {
|
||||||
|
background-color: #8bbbdd;
|
||||||
|
}
|
||||||
|
|
||||||
|
h4 {
|
||||||
|
color: #343434;
|
||||||
|
font-family: "lato-bolder", "Open Sans", sans-serif;
|
||||||
|
line-height: 18pt;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user