"use strict"; var linkQryEls = document.getElementsByClassName('link--QRY'); var i = linkQryEls.length; while (i--) { linkQryEls[i].addEventListener('click', function (e) { e.preventDefault(); var resp = prompt('Please enter required input: ', ''); if ((resp !== null) && (resp !== "")) { window.location.href = e.target.href + '?' + resp; } return false; }); } var imgPreviewEls = document.getElementsByClassName('img-preview'); i = imgPreviewEls.length; var _loop_1 = function () { var imgPreviewEl = imgPreviewEls[i]; var child = imgPreviewEl.children[0]; var thumbnailUrl = child.src; child.addEventListener('load', function (e) { child.classList.remove('faded'); }); imgPreviewEls[i].addEventListener('click', function (e) { e.preventDefault(); child.classList.add('faded'); if (child.classList.contains('expanded')) { child.classList.remove('expanded'); child.src = thumbnailUrl; } else { child.classList.add('expanded'); child.src = imgPreviewEl.href; } return false; }); }; while (i--) { _loop_1(); }