diff options
Diffstat (limited to 'design/templates/details/entry.html')
-rw-r--r-- | design/templates/details/entry.html | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/design/templates/details/entry.html b/design/templates/details/entry.html index eb9d83c..0cc550e 100644 --- a/design/templates/details/entry.html +++ b/design/templates/details/entry.html @@ -112,28 +112,38 @@ document.addEventListener("DOMContentLoaded", function(event) { var leaflet = document.createElement('script'); leaflet.src = "/media/js/leaflet-master/leaflet-mod.js"; document.body.appendChild(leaflet); - var detail = document.createElement('script'); - detail.src = "/media/js/detail.min.js"; - document.body.appendChild(detail); var lightbox = document.createElement('script'); lightbox.src = "/media/js/lightbox.js"; document.body.appendChild(lightbox); - - var opts= { - //nextOnClick: false, - captions: true, - onload: function(){ - var im = document.getElementById("jslghtbx-contentwrapper"); - var link = im.appendChild(document.createElement('a')) - link.href = im.firstChild.src; - link.innerHTML= "open "; - link.target = "_blank"; - link.setAttribute('class', 'p-link'); - im.appendChild(link); + leaflet.onload = function(){ + var detail = document.createElement('script'); + detail.src = "/media/js/detail.min.js"; + document.body.appendChild(detail); + {% with object.get_template_name_display as t %}{%if t == "single" or t == "single-dark" %} + detail.onload = function(){ + createMap(); + var open = false; } - }; - var lightbox = new Lightbox(); - lightbox.load(opts); + {%endif%}{%endwith%} + } + + lightbox.onload = function() { + var opts= { + //nextOnClick: false, + captions: true, + onload: function(){ + var im = document.getElementById("jslghtbx-contentwrapper"); + var link = im.appendChild(document.createElement('a')) + link.href = im.firstChild.src; + link.innerHTML= "open "; + link.target = "_blank"; + link.setAttribute('class', 'p-link'); + im.appendChild(link); + } + }; + var lightbox = new Lightbox(); + lightbox.load(opts); + } {% if object.enable_comments %} {% get_comment_count for object as comment_count %} {%if comment_count > 0 %} @@ -148,10 +158,6 @@ document.addEventListener("DOMContentLoaded", function(event) { } {%endif%} {%endif%} - {% with object.get_template_name_display as t %}{%if t == "single" or t == "single-dark" %} - createMap(); - var open = false; - {%endif%}{%endwith%} {% if object.has_video %} var tester = document.getElementsByClassName("vidauto"); var wrapper = document.getElementById('wrapper'); |