forked from CGM_Public/pretix_original
Cart: Disable sneak peek on very small carts (#3512)
This commit is contained in:
@@ -4,9 +4,18 @@ setup_collapsible_details = function (el) {
|
|||||||
|
|
||||||
el.find('details.sneak-peek:not([open])').each(function() {
|
el.find('details.sneak-peek:not([open])').each(function() {
|
||||||
this.open = true;
|
this.open = true;
|
||||||
var $elements = $("> :not(summary)", this).show().filter(':not(.sneak-peek-trigger)').attr('aria-hidden', 'true');
|
var $elements = $("> :not(summary)", this).show().filter(':not(.sneak-peek-trigger)');
|
||||||
|
|
||||||
var container = this;
|
var container = this;
|
||||||
|
|
||||||
|
if ($("> :not(summary)", this).show().filter(':not(.sneak-peek-trigger)').height() < 200) {
|
||||||
|
$(".sneak-peek-trigger", this).remove();
|
||||||
|
$(container).removeClass('sneak-peek');
|
||||||
|
container.style.removeProperty('height');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$elements.attr('aria-hidden', 'true');
|
||||||
|
|
||||||
var trigger = $('summary, .sneak-peek-trigger button', container);
|
var trigger = $('summary, .sneak-peek-trigger button', container);
|
||||||
function onclick(e) {
|
function onclick(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|||||||
Reference in New Issue
Block a user