Better styling of popup dialog

This commit is contained in:
Magnus Hoff 2017-12-01 16:22:36 +01:00
parent 5ce9b37ab0
commit 578d525e25
2 changed files with 25 additions and 7 deletions

View file

@ -21,7 +21,7 @@ function isEdited(form) {
}
function loginDialog(loginUrl) {
const loginDialogHtml = "<div class=popup><p>Your changes could not be saved</p><p>Log in and try again</p><div><button>Never mind</button> <a href='' target=login>Open login page</a></div></div>";
const loginDialogHtml = "<div class=popup><div class=message><p>Your changes could not be saved</p><p>Log in and try again</p></div><div class=btn-row><button>Never mind</button> <a href='' target=login>Open login page</a></div></div>";
const dialog = document.createElement("div");
dialog.className = "modal-block";

View file

@ -438,22 +438,40 @@ input[type="search"] {
top: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.6);
display: flex;
align-items: center;
justify-content: center;
}
.popup {
position: fixed;
display: flex;
flex-direction: column;
width: 300px;
left: calc(50% - 150px);
height: 150px;
top: calc(50% - 75px);
height: 200px;
text-align: center;
background: #eee;
box-shadow: 2px 2px 8px rgba(0,0,0, 0.25);
}
.popup>.message {
flex-grow: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin: 16px 32px;
max-width: 600px;
}
.popup>.btn-row {
padding: 16px;
background: #ccc;
}
@media print {
@page {
margin: 25mm;