Project

General

Profile

Patch #43976 » 0003-Use-stylesheet-instead-of-JavaScript.patch

Takashi Kato, 2026-04-19 05:34

View differences:

app/assets/javascripts/application-legacy.js
}).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);
}
function setupWikiTableSortableHeader() {
if (typeof Tablesort === 'undefined') { return; }
$('div.wiki table').each(function(i, table){
......
$(document).ready(hideOnLoad);
$(document).ready(addFormObserversForDoubleSubmit);
$(document).ready(defaultFocus);
$(document).ready(setupAttachmentDetail);
$(document).ready(setupFilePreviewNavigation);
$(document).on('focus', '[data-auto-complete=true]', function(event) {
inlineAutoComplete(event.target);
app/assets/stylesheets/application.css
image-orientation: from-image;
}
div#content:has(.filecontent-container) {
display: flex;
flex-direction: column;
}
.filecontent-container {
position: relative;
margin-block-end: 20px;
min-block-size: 200px;
flex-grow: 1
}
.filecontent-container > .filecontent {
position: absolute;
(3-3/3)