mirror of
https://github.com/pretix/pretix.git
synced 2026-05-18 17:24:03 +00:00
remove _renewed_message and just show dialog
This commit is contained in:
@@ -511,10 +511,9 @@
|
|||||||
</button>
|
</button>
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
<dialog role="alertdialog" id="cart-extend-feedback-dialog" class="inline-dialog" aria-labelledby="cart-extend-feedback cart-deadline">
|
<dialog role="alertdialog" id="cart-extend-feedback-dialog" class="inline-dialog" aria-labelledby="cart-deadline">
|
||||||
<form method="dialog">
|
<form method="dialog">
|
||||||
<p>
|
<p>
|
||||||
<span id="cart-extend-feedback" class="text-muted sr-only"></span>
|
|
||||||
<button class="btn btn-default" autofocus value="OK">
|
<button class="btn btn-default" autofocus value="OK">
|
||||||
<span role="img" aria-label="{% trans "OK" %}">
|
<span role="img" aria-label="{% trans "OK" %}">
|
||||||
{% icon "check" %}
|
{% icon "check" %}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ var cart = {
|
|||||||
_deadline_call: 0,
|
_deadline_call: 0,
|
||||||
_time_offset: 0,
|
_time_offset: 0,
|
||||||
_prev_diff_minutes: 0,
|
_prev_diff_minutes: 0,
|
||||||
_renewed_message: "",
|
|
||||||
|
|
||||||
_get_now: function () {
|
_get_now: function () {
|
||||||
return moment().add(cart._time_offset, 'ms');
|
return moment().add(cart._time_offset, 'ms');
|
||||||
@@ -66,11 +65,6 @@ var cart = {
|
|||||||
).replace(/\{num\}/g, diff_minutes)
|
).replace(/\{num\}/g, diff_minutes)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$("#cart-extend-feedback").text(cart._renewed_message);
|
|
||||||
var dialog = $("#cart-extend-feedback-dialog").get(0);
|
|
||||||
if (cart._renewed_message) {
|
|
||||||
dialog.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
cart._prev_diff_minutes = diff_minutes;
|
cart._prev_diff_minutes = diff_minutes;
|
||||||
}
|
}
|
||||||
@@ -106,15 +100,9 @@ var cart = {
|
|||||||
$("#cart-deadline").attr("data-expires"),
|
$("#cart-deadline").attr("data-expires"),
|
||||||
$("#cart-deadline").attr("data-max-expiry-extend")
|
$("#cart-deadline").attr("data-max-expiry-extend")
|
||||||
);
|
);
|
||||||
$("#cart-extend-feedback-dialog").on("keydown", function (e) {
|
|
||||||
// prevent enter or space-bar from bubbling up and closing the cart-panel
|
|
||||||
e.stopPropagation();
|
|
||||||
}).find("button").on("blur", function() {
|
|
||||||
this.closest("dialog").close();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
set_deadline: function (expiry, max_extend, renewed_message) {
|
set_deadline: function (expiry, max_extend) {
|
||||||
"use strict";
|
"use strict";
|
||||||
cart._expiry_notified = false;
|
cart._expiry_notified = false;
|
||||||
cart._deadline = moment(expiry);
|
cart._deadline = moment(expiry);
|
||||||
@@ -123,7 +111,6 @@ var cart = {
|
|||||||
}
|
}
|
||||||
cart._deadline_timeout = null;
|
cart._deadline_timeout = null;
|
||||||
cart._max_extend = moment(max_extend);
|
cart._max_extend = moment(max_extend);
|
||||||
cart._renewed_message = renewed_message || "";
|
|
||||||
cart.draw_deadline();
|
cart.draw_deadline();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -135,9 +122,17 @@ $(function () {
|
|||||||
cart.init();
|
cart.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$("#cart-extend-feedback-dialog").on("keydown", function (e) {
|
||||||
|
// prevent enter or space-bar from bubbling up and closing the cart-panel
|
||||||
|
e.stopPropagation();
|
||||||
|
}).find("button").on("blur", function() {
|
||||||
|
this.closest("dialog").close();
|
||||||
|
});
|
||||||
|
|
||||||
$("#cart-extend-form").on("pretix:async-task-success", function(e, data) {
|
$("#cart-extend-form").on("pretix:async-task-success", function(e, data) {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
cart.set_deadline(data.expiry, data.max_expiry_extend, data.message);
|
cart.set_deadline(data.expiry, data.max_expiry_extend);
|
||||||
|
$("#cart-extend-feedback-dialog").get(0).show();
|
||||||
} else {
|
} else {
|
||||||
alert(data.message);
|
alert(data.message);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user