fix button sensibilities when there is only one image
authorgc <gc>
Sat, 2 Apr 2005 18:03:27 +0000 (18:03 +0000)
committergc <gc>
Sat, 2 Apr 2005 18:03:27 +0000 (18:03 +0000)
lib/booh/html-merges.rb

index a4b20d0e0a2dc927f5d76567b9c03dcfc50d01c0..26489505e5cbfcdcdb2ad5932aa8b915383f453b 100644 (file)
@@ -124,22 +124,24 @@ function init() {
 
     preload();
     display_current();
+    if (images.length == 1) {
+        document.getElementById("b_slideshow").disabled = true;
+    }
 }
 
 function update_sensibilities() {
     if (current == 0) {
         document.getElementById("b_first").disabled = true;
         document.getElementById("b_previous").disabled = true;
-        document.getElementById("b_next").disabled = false;
-        document.getElementById("b_last").disabled = false;
-    } else if (current == images.length - 1) {
+    } else {
         document.getElementById("b_first").disabled = false;
         document.getElementById("b_previous").disabled = false;
+    }
+
+    if (current == images.length - 1) {
         document.getElementById("b_next").disabled = true;
         document.getElementById("b_last").disabled = true;
     } else {
-        document.getElementById("b_first").disabled = false;
-        document.getElementById("b_previous").disabled = false;
         document.getElementById("b_next").disabled = false;
         document.getElementById("b_last").disabled = false;
     }