]> git.sesse.net Git - pr0n/blobdiff - files/pr0n-fullscreen.js
Hide the infobox immediately when going to immersive mode.
[pr0n] / files / pr0n-fullscreen.js
index b431a3c33a1a9f42adadb79545b6d29a8fca6150..7f5aed6dbe79ebce3b0507674232e923a4c3e415 100644 (file)
@@ -275,8 +275,14 @@ function position_image(img, backend_width, backend_height, offset, box)
 
        if (box) {
                img.style.top = Math.min(top + height, screen_size[1] - 24) / dpr + "px";
-               img.style.width = (width / dpr) + "px";
                img.style.height = "24px";
+               img.style.width = null;
+               img.style.whiteSpace = 'nowrap';
+               if (offset == 0) {
+                       // Hide the box if there's no room for all the text.
+                       img.style.opacity = (img.clientWidth < width / dpr + 10) ? null : 0.0;
+               }
+               img.style.width = (width / dpr) + "px";
        } else {
                img.style.top = (top / dpr) + "px";
                img.style.lineHeight = (height / dpr) + "px";
@@ -311,7 +317,7 @@ function update_shown_images()
                //    inum !== global_image_num + 1) {
                //      to_remove.push(child);
                //}
-               if (inum !== global_image_num) {
+               if (inum !== global_image_num || (child.className === "fsbox" && !global_infobox)) {
                        to_remove.push(child);
                }
        }