Skip to content
Snippets Groups Projects
Commit b5dd4ba1 authored by jonasled's avatar jonasled
Browse files

add close button to image zoom dialog

parent 938e1bc1
No related branches found
No related tags found
No related merge requests found
Pipeline #677 passed
......@@ -31,3 +31,25 @@
width: auto;
}
}
a.dialogClose{
float:right;
margin-top:-30px;
margin-right:-30px;
cursor:pointer;
color: #fff;
border: 1px solid #AEAEAE;
border-radius: 30px;
background: #605F61;
font-size: 31px;
font-weight: bold;
display: inline-block;
line-height: 0;
padding: 11px 3px;
text-decoration: none;
}
.dialogClose:before {
content: "×";
}
......@@ -7,14 +7,17 @@ function createDialogImage(url:string) {
}
function createDialogHTML(html:string, customClasses = "") {
var dialog = document.createElement("div");
let dialog = document.createElement("div");
dialog.classList.add("dialog");
dialog.onclick = function () {
fade(dialog, -0.04, true);
}
dialog.innerHTML = `
<div class="dialogContent ${customClasses}">${html}</div>`;
<div class="dialogContent ${customClasses}">
<a class="dialogClose"></a>
${html}
</div>`;
document.body.appendChild(dialog);
fade(dialog, 0.04);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment