properly support embedded videos with "original" size selected
[booh] / data / booh / themes / cardu / root / booh.js
index 241bb5c310f4b2c3b4419400f9c0769462cf74c2..3ddff42d896f0d25ed63bdbe0ca53b52e869ec52 100644 (file)
@@ -233,7 +233,13 @@ function show_current_text() {
         document.getElementById('main_text').innerHTML = captions[current];
         for (i = 0; i < other_sizes.length; i++) { 
             if (other_sizes[i] == "original") {
-                document.getElementById('link' + other_sizes[i]).href = eval("elements_" + other_sizes[i] + "[current]");
+                var original = eval("elements_" + other_sizes[i] + "[current]");
+                if (original != undefined) {
+                    document.getElementById('link' + other_sizes[i]).href = original;
+                    document.getElementById('link' + other_sizes[i]).style.display = '';
+                } else {
+                    document.getElementById('link' + other_sizes[i]).style.display = 'none';
+                }
             } else {
                 document.getElementById('link' + other_sizes[i]).href = 'image-' + other_sizes[i] + dbltilda_htmlsuffix + '#current=' + eval("elements_" + other_sizes[i] + "[current]");
             }