From 442145bde481c457e0d68c41ad42b1a22f0d0f16 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Mon, 27 Jul 2026 22:12:13 +0200 Subject: [PATCH] Max height for timeline --- .../static/pretixcontrol/js/ui/dashboard.js | 32 ++++++++++--------- .../static/pretixcontrol/scss/main.scss | 4 +++ 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/pretix/static/pretixcontrol/js/ui/dashboard.js b/src/pretix/static/pretixcontrol/js/ui/dashboard.js index 4960c40de0..993d833d79 100644 --- a/src/pretix/static/pretixcontrol/js/ui/dashboard.js +++ b/src/pretix/static/pretixcontrol/js/ui/dashboard.js @@ -1,18 +1,20 @@ -/*global $,gettext*/ +/* global $,gettext */ $(function () { - if ($("div[data-lazy-id]").length == 0) { - return; - } - $.getJSON("widgets.json" + ($("select[name='subevent']").val() ? "?subevent=" + $("select[name='subevent']").val() : ""), function (data) { - $.each(data.widgets, function (k, v) { - $("[data-lazy-id=" + v.lazy + "]").removeClass("widget-lazy-loading"); - $("[data-lazy-id=" + v.lazy + "] .widget").html(v.content); - }); - }); -}); + if ($('div[data-lazy-id]').length == 0) { + return + } + $.getJSON('widgets.json' + ($('select[name=\'subevent\']').val() ? '?subevent=' + $('select[name=\'subevent\']').val() : ''), function (data) { + $.each(data.widgets, function (k, v) { + $('[data-lazy-id=' + v.lazy + ']').removeClass('widget-lazy-loading') + $('[data-lazy-id=' + v.lazy + '] .widget').html(v.content) + }) + }) +}) $(function () { - if ($("#logs_target").length == 0) { - return; - } -}); + $('.timeline').each(function () { + let $tl = $(this) + let $first = $(this).find('.row:not(.text-muted)').first() + $tl.scrollTop($tl.scrollTop() + Math.max($first.position().top - 50, 0)) + }) +}) diff --git a/src/pretix/static/pretixcontrol/scss/main.scss b/src/pretix/static/pretixcontrol/scss/main.scss index 587dd3629c..e81bd3b47b 100644 --- a/src/pretix/static/pretixcontrol/scss/main.scss +++ b/src/pretix/static/pretixcontrol/scss/main.scss @@ -727,6 +727,10 @@ h1 .label { } .timeline { + max-height: 200px; + overflow-y: auto; + position: relative; + .col-date { position: relative; min-height: 1px;