// Build the div which contains the QR-Code:
var element = document.createElement('div');
- element.id="permalinkQrcode";
+ element.id = 'permalinkQrcode';
// Make QR-Code div commit sepuku when clicked:
if ( element.attachEvent ){
element.appendChild(image);
element.innerHTML += "<br>Click to close";
caller.parentNode.appendChild(element);
+
+ // Show the QRCode
+ qrcodeImage = document.getElementById('permalinkQrcode');
+ // Workaround to deal with newly created element lag for transition.
+ window.getComputedStyle(qrcodeImage).opacity;
+ qrcodeImage.className = 'show';
}
else
{
// Remove any displayed QR-Code
function removeQrcode()
{
- var elem = document.getElementById("permalinkQrcode");
+ var elem = document.getElementById('permalinkQrcode');
if (elem) {
elem.parentNode.removeChild(elem);
}