1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-19 15:01:14 +00:00

Let pagination always be visible (#29395).

Patch by Felix Gliesche.


git-svn-id: http://svn.redmine.org/redmine/trunk@17570 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA 2018-10-04 13:31:14 +00:00
parent 7516823617
commit 00311c574e
3 changed files with 34 additions and 1 deletions

View File

@ -10,7 +10,9 @@
<p><%= "#{@attachment.description} - " unless @attachment.description.blank? %> <p><%= "#{@attachment.description} - " unless @attachment.description.blank? %>
<span class="author"><%= link_to_user(@attachment.author) %>, <%= format_time(@attachment.created_on) %></span></p> <span class="author"><%= link_to_user(@attachment.author) %>, <%= format_time(@attachment.created_on) %></span></p>
</div> </div>
<div class="filecontent-container">
<%= yield %> <%= yield %>
</div>
<span class="pagination filepreview"> <span class="pagination filepreview">
<%= render_pagination %> <%= render_pagination %>

View File

@ -904,9 +904,29 @@ $(function ($) {
}).change(); }).change();
}); });
function setFilecontentContainerHeight() {
var $filecontainer = $('.filecontent-container');
var fileTypeSelectors = ['.image', 'video'];
if($filecontainer.length > 0 && $filecontainer.find(fileTypeSelectors.join(',')).length === 1) {
var containerOffsetTop = $filecontainer.offset().top;
var containerMarginBottom = parseInt($filecontainer.css('marginBottom'));
var paginationHeight = $filecontainer.next('.pagination').height();
var diff = containerOffsetTop + containerMarginBottom + paginationHeight;
$filecontainer.css('height', 'calc(100vh - ' + diff + 'px)')
}
}
function setupAttachmentDetail() {
setFilecontentContainerHeight();
$(window).resize(setFilecontentContainerHeight);
}
$(document).ready(setupAjaxIndicator); $(document).ready(setupAjaxIndicator);
$(document).ready(hideOnLoad); $(document).ready(hideOnLoad);
$(document).ready(addFormObserversForDoubleSubmit); $(document).ready(addFormObserversForDoubleSubmit);
$(document).ready(defaultFocus); $(document).ready(defaultFocus);
$(document).ready(setupAttachmentDetail);
$(document).ready(setupTabs); $(document).ready(setupTabs);
$(document).ready(setupFilePreviewNavigation); $(document).ready(setupFilePreviewNavigation);

View File

@ -1507,3 +1507,14 @@ img.filecontent.image {background-image: url(../images/transparent.png);}
img { img {
image-orientation: from-image; image-orientation: from-image;
} }
.filecontent-container {
position: relative;
margin-bottom: 20px;
min-height: 200px;
}
.filecontent-container > .filecontent {
position: absolute;
max-height: 100%;
max-width: 100%;
}