Fixed a bug, where the header could be hidden after closing a photo

pull/104/head
Tobias Reich 10 years ago
parent 232e963bcc
commit 270a2d8e0c

File diff suppressed because one or more lines are too long

@ -11,41 +11,40 @@ view = {
show: function() { show: function() {
var newMargin = -1*($("#imageview #image").height()/2)+20;
clearTimeout($(window).data("timeout")); clearTimeout($(window).data("timeout"));
if (visible.photo()) { lychee.imageview.removeClass("full");
lychee.imageview.removeClass("full"); lychee.header.removeClass("hidden");
lychee.header.removeClass("hidden"); lychee.loadingBar.css("opacity", 1);
lychee.loadingBar.css("opacity", 1);
if ($("#imageview #image.small").length>0) { if ($("#imageview #image.small").length>0) $("#imageview #image").css('margin-top', newMargin);
$("#imageview #image").css({ else $("#imageview #image").removeClass('full');
marginTop: -1*($("#imageview #image").height()/2)+20
});
} else {
$("#imageview #image").removeClass('full');
}
}
}, },
hide: function(e, delay) { hide: function(e, delay) {
var newMargin = -1*($("#imageview #image").height()/2);
if (delay===undefined) delay = 500; if (delay===undefined) delay = 500;
if (visible.photo()&&!visible.infobox()&&!visible.contextMenu()&&!visible.message()) { if (visible.photo()&&!visible.infobox()&&!visible.contextMenu()&&!visible.message()) {
clearTimeout($(window).data("timeout")); clearTimeout($(window).data("timeout"));
$(window).data("timeout", setTimeout(function() { $(window).data("timeout", setTimeout(function() {
lychee.imageview.addClass("full"); lychee.imageview.addClass("full");
lychee.header.addClass("hidden"); lychee.header.addClass("hidden");
lychee.loadingBar.css("opacity", 0); lychee.loadingBar.css("opacity", 0);
if ($("#imageview #image.small").length>0) {
$("#imageview #image").css({ if ($("#imageview #image.small").length>0) $("#imageview #image").css('margin-top', newMargin);
marginTop: -1*($("#imageview #image").height()/2) else $("#imageview #image").addClass('full');
});
} else {
$("#imageview #image").addClass('full');
}
}, delay)); }, delay));
} }
}, },
@ -373,7 +372,7 @@ view = {
hide: function() { hide: function() {
if (!visible.controls()) view.header.show(); view.header.show();
if (visible.infobox) view.infobox.hide(); if (visible.infobox) view.infobox.hide();
lychee.content.removeClass("view"); lychee.content.removeClass("view");

Loading…
Cancel
Save