2018-10-30 14:05:23 +00:00
|
|
|
function Lightbox()
|
|
|
|
{
|
|
|
|
this.container = null;
|
|
|
|
this.item = null;
|
|
|
|
|
|
|
|
this.install = function()
|
|
|
|
{
|
|
|
|
this.container = document.getElementById("lightbox");
|
|
|
|
this.container.innerHTML += `<div class="lightbox-back" onclick="main.lightbox.close()"></div>`;
|
|
|
|
this.container.innerHTML += `<div id="lightbox-item" class="lightbox-item"></div>`;
|
|
|
|
this.item = document.getElementById("lightbox-item");
|
|
|
|
}
|
|
|
|
|
|
|
|
this.load = function(file)
|
|
|
|
{
|
2018-10-30 14:38:55 +00:00
|
|
|
this.item.innerHTML = `<img class="lightbox-img" src="${file}" onclick="main.lightbox.close()">`;
|
2018-10-30 14:05:23 +00:00
|
|
|
this.container.style.display = 'block';
|
|
|
|
}
|
|
|
|
|
|
|
|
this.close = function()
|
|
|
|
{
|
|
|
|
if (this.container.style.display != 'none')
|
|
|
|
{
|
|
|
|
this.container.style.display = 'none';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|