properly support embedded videos with "original" size selected
[booh] / data / booh / themes / sbs / root / booh.js
index 66b0f90c6c2c088866d658e3c1f11723e9bb5f36..7b8eb7302bb4569ad1c1293350c96588c7eca5f6 100644 (file)
@@ -224,7 +224,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]");
             }