aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/011-display.js
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2012-04-19 20:52:41 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2012-04-19 20:53:12 +0200
commit99b3118cce77484c007bf78c16afb04f7bbeb73e (patch)
treed1b00ebabcf50209d76b233023fab3025fe60f1b /web/js/011-display.js
parentStop previous fades on next fade. Thanks artcfox. (diff)
downloadPhotoFloat-99b3118cce77484c007bf78c16afb04f7bbeb73e.tar.xz
PhotoFloat-99b3118cce77484c007bf78c16afb04f7bbeb73e.zip
Do fullscreen properly.
Diffstat (limited to 'web/js/011-display.js')
-rw-r--r--web/js/011-display.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/web/js/011-display.js b/web/js/011-display.js
index b7966e9..ab56562 100644
--- a/web/js/011-display.js
+++ b/web/js/011-display.js
@@ -27,6 +27,7 @@ $(document).ready(function() {
var previousPhoto = null;
var originalTitle = document.title;
var photoFloat = new PhotoFloat();
+ var maxSize = 800;
/* Displays */
@@ -152,8 +153,7 @@ $(document).ready(function() {
image.css("height", "100%").css("width", "auto").css("position", "").css("bottom", "");
}
function showPhoto() {
- var maxSize, width, height, photoSrc, previousPhoto, nextPhoto, nextLink, text;
- maxSize = 1024;
+ var width, height, photoSrc, previousPhoto, nextPhoto, nextLink, text;
width = currentPhoto.size[0];
height = currentPhoto.size[1];
if (width > height) {
@@ -288,17 +288,19 @@ $(document).ready(function() {
$("#photo-box").mouseleave(function() {
$("#photo-links").stop().fadeOut("slow");
});
- $("#next, #back, #fullscreen").mouseenter(function() {
+ $("#next, #back").mouseenter(function() {
$(this).stop().fadeTo("slow", 1);
});
$("#next, #back").mouseleave(function() {
$(this).stop().fadeTo("slow", 0.35);
});
if ($.support.fullscreen) {
+ $("#fullscreen-divider").show();
$("#fullscreen").show().click(function() {
- $("#photo").fullScreen();
- }).mouseleave(function() {
- $(this).stop().fadeTo("slow", 0.50);
+ $("#photo").fullScreen({callback: function(isFullscreen) {
+ maxSize = isFullscreen ? 1024 : 800;
+ showPhoto();
+ }});
});
}
$("#metadata-link").click(function() {