1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-18 00:00:00 +00:00

[img_view] enable view prev/next & improved ui

This commit is contained in:
llj
2013-01-31 13:17:28 +08:00
parent c9fa7d3ff7
commit 37f284d11a
5 changed files with 79 additions and 9 deletions

View File

@@ -17,11 +17,21 @@
{% endif %}
{% if filetype == 'Image' %}
window.onload = function() {
if ($('#image-view').width() > $('#file-view').width()) {
$('#image-view').css('width', $('#file-view').width() - 4);
}
$(window).load(function() {
var img_ht = $('#image-view').height();
var file_view_ht = parseInt($('#file-view').css('min-height'));
var prev_next_ht = 0;
if ($('#img-prev-next').length > 0) {
prev_next_ht = $('#img-prev-next').outerHeight(true);
}
if (img_ht < file_view_ht - prev_next_ht) {
$('#image-view').css({'margin-top':(file_view_ht - img_ht - prev_next_ht)/2});
}
if ($('#image-view').outerWidth() > 950) { // for ie 6
$('#image-view').css('width', 946);
}
$('#image-view').removeClass('vh');
});
{% endif %}
{% if filetype == 'SVG' %}