X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=files%2Fpr0n-fullscreen.js;h=75ef1f81ac49895bcb9e14e8d65b24cc28bf825b;hb=6de4bf1f755b62791d9721ee3a9cfcaed53e4571;hp=b431a3c33a1a9f42adadb79545b6d29a8fca6150;hpb=c8c8d4ba8a2e5a3c8b6a6b787a354f72c29964e2;p=pr0n diff --git a/files/pr0n-fullscreen.js b/files/pr0n-fullscreen.js index b431a3c..75ef1f8 100644 --- a/files/pr0n-fullscreen.js +++ b/files/pr0n-fullscreen.js @@ -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";