Cart: Display subevent location and end time in cart (#2191)

This commit is contained in:
Raphael Michel
2021-09-08 11:24:39 +02:00
committed by GitHub
parent a27b8bf213
commit 673a38ddc8
4 changed files with 99 additions and 13 deletions

View File

@@ -79,4 +79,24 @@ $(function () {
e.preventDefault();
return true;
});
$(".cart-icon-details.collapse-lines").each(function () {
var $content = $(this).find(".content");
var original_html = $content.html();
var br_exp = /<br\s*\/?>/i;
$content.text(original_html.split(br_exp).join(', '));
if ($content.get(0).scrollWidth > $content.get(0).offsetWidth) {
var $handler = $("<button>")
.text($(this).attr("data-expand-text"))
.addClass("btn btn-link collapse-handler")
.attr("aria-controls", $content.attr('id'))
.attr("aria-expanded", "false");
$handler.on("click", function (ev) {
$content.html(original_html);
$handler.attr("aria-expanded", "true").attr("aria-hidden", "true");
$handler.hide();
});
$(this).append($handler);
}
})
});

View File

@@ -66,6 +66,32 @@
margin-top: 5px;
}
}
.cart-icon-details {
position: relative;
padding-left: 1.4em;
text-indent: 0;
.fa, svg {
position: absolute;
left: 0;
top: .22em;
}
&.collapse-lines {
.content {
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.collapse-handler {
cursor: pointer;
display: inline;
padding: 0;
text-decoration: underline;
}
}
}
}
.apply-voucher {