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
1211 1211
  }).change();
1212 1212
});
1213 1213

  
1214
function setFilecontentContainerHeight() {
1215
  var $filecontainer = $('.filecontent-container');
1216
  var fileTypeSelectors = ['.image', 'video'];
1217

  
1218
  if($filecontainer.length > 0 && $filecontainer.find(fileTypeSelectors.join(',')).length === 1) {
1219
    var containerOffsetTop = $filecontainer.offset().top;
1220
    var containerMarginBottom = parseInt($filecontainer.css('marginBottom'));
1221
    var paginationHeight = $filecontainer.next('.pagination').height();
1222
    var diff = containerOffsetTop + containerMarginBottom + paginationHeight;
1223

  
1224
    $filecontainer.css('height', 'calc(100vh - ' + diff + 'px)')
1225
  }
1226
}
1227

  
1228
function setupAttachmentDetail() {
1229
  setFilecontentContainerHeight();
1230
  $(window).resize(setFilecontentContainerHeight);
1231
}
1232

  
1233 1214
function setupWikiTableSortableHeader() {
1234 1215
  if (typeof Tablesort === 'undefined') { return; }
1235 1216
  $('div.wiki table').each(function(i, table){
......
1454 1435
$(document).ready(hideOnLoad);
1455 1436
$(document).ready(addFormObserversForDoubleSubmit);
1456 1437
$(document).ready(defaultFocus);
1457
$(document).ready(setupAttachmentDetail);
1458 1438
$(document).ready(setupFilePreviewNavigation);
1459 1439
$(document).on('focus', '[data-auto-complete=true]', function(event) {
1460 1440
  inlineAutoComplete(event.target);
app/assets/stylesheets/application.css
2530 2530
  image-orientation: from-image;
2531 2531
}
2532 2532

  
2533
div#content:has(.filecontent-container) {
2534
  display: flex;
2535
  flex-direction: column;
2536
}
2537

  
2533 2538
.filecontent-container {
2534 2539
  position: relative;
2535 2540
  margin-block-end: 20px;
2536 2541
  min-block-size: 200px;
2542
  flex-grow: 1
2537 2543
}
2538 2544
.filecontent-container > .filecontent {
2539 2545
  position: absolute;
(3-3/3)