mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Fix cart sneak-peek on async error
This commit is contained in:
@@ -1,6 +1,31 @@
|
|||||||
/*global $ */
|
/*global $ */
|
||||||
|
|
||||||
setup_collapsible_details = function (el) {
|
setup_collapsible_details = function (el) {
|
||||||
|
|
||||||
|
el.find('details.sneak-peek:not([open])').each(function() {
|
||||||
|
this.open = true;
|
||||||
|
var $elements = $("> :not(summary)", this).show().filter(':not(.sneak-peek-trigger)').attr('aria-hidden', 'true');
|
||||||
|
|
||||||
|
var container = this;
|
||||||
|
var trigger = $('summary, .sneak-peek-trigger button', container);
|
||||||
|
function onclick(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
container.addEventListener('transitionend', function() {
|
||||||
|
$(container).removeClass('sneak-peek');
|
||||||
|
container.style.removeProperty('height');
|
||||||
|
}, {once: true});
|
||||||
|
container.style.height = container.scrollHeight + 'px';
|
||||||
|
$('.sneak-peek-trigger', container).fadeOut(function() {
|
||||||
|
$(this).remove();
|
||||||
|
});
|
||||||
|
$elements.removeAttr('aria-hidden');
|
||||||
|
|
||||||
|
trigger.off('click', onclick);
|
||||||
|
}
|
||||||
|
trigger.on('click', onclick);
|
||||||
|
});
|
||||||
|
|
||||||
var isOpera = Object.prototype.toString.call(window.opera) == '[object Opera]';
|
var isOpera = Object.prototype.toString.call(window.opera) == '[object Opera]';
|
||||||
el.find("details summary").click(function (e) {
|
el.find("details summary").click(function (e) {
|
||||||
if (this.tagName !== "A" && $(e.target).closest("a").length > 0) {
|
if (this.tagName !== "A" && $(e.target).closest("a").length > 0) {
|
||||||
|
|||||||
@@ -307,30 +307,6 @@ $(function () {
|
|||||||
|
|
||||||
$("#ajaxerr").on("click", ".ajaxerr-close", ajaxErrDialog.hide);
|
$("#ajaxerr").on("click", ".ajaxerr-close", ajaxErrDialog.hide);
|
||||||
|
|
||||||
$('details.sneak-peek:not([open])').each(function() {
|
|
||||||
this.open = true;
|
|
||||||
var $elements = $("> :not(summary)", this).show().filter(':not(.sneak-peek-trigger)').attr('aria-hidden', 'true');
|
|
||||||
|
|
||||||
var container = this;
|
|
||||||
var trigger = $('summary, .sneak-peek-trigger button', container);
|
|
||||||
function onclick(e) {
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
container.addEventListener('transitionend', function() {
|
|
||||||
$(container).removeClass('sneak-peek');
|
|
||||||
container.style.removeProperty('height');
|
|
||||||
}, {once: true});
|
|
||||||
container.style.height = container.scrollHeight + 'px';
|
|
||||||
$('.sneak-peek-trigger', container).fadeOut(function() {
|
|
||||||
$(this).remove();
|
|
||||||
});
|
|
||||||
$elements.removeAttr('aria-hidden');
|
|
||||||
|
|
||||||
trigger.off('click', onclick);
|
|
||||||
}
|
|
||||||
trigger.on('click', onclick);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Copy answers
|
// Copy answers
|
||||||
$(".js-copy-answers").click(function (e) {
|
$(".js-copy-answers").click(function (e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|||||||
Reference in New Issue
Block a user