From f262cd632cdfc8e833bcfcb4d8fcf9c1ed4cfdcd Mon Sep 17 00:00:00 2001 From: Richard Schreiber Date: Wed, 16 Aug 2023 15:02:02 +0200 Subject: [PATCH] Chekout: make disabling sneak-peek more robust (#3527) --- src/pretix/static/pretixbase/js/details.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pretix/static/pretixbase/js/details.js b/src/pretix/static/pretixbase/js/details.js index fd2feaa18..53b865e36 100644 --- a/src/pretix/static/pretixbase/js/details.js +++ b/src/pretix/static/pretixbase/js/details.js @@ -7,7 +7,9 @@ setup_collapsible_details = function (el) { var $elements = $("> :not(summary)", this).show().filter(':not(.sneak-peek-trigger)'); var container = this; - if ($("> :not(summary)", this).show().filter(':not(.sneak-peek-trigger)').height() < 200) { + if (Array.prototype.reduce.call($elements, function (h, e) { + return h + $(e).outerHeight(); + }, 0) < 200) { $(".sneak-peek-trigger", this).remove(); $(container).removeClass('sneak-peek'); container.style.removeProperty('height');