mirror of
https://github.com/pretix/pretix.git
synced 2026-05-16 17:03:58 +00:00
force item-order-min on blur if quantity not 0
This commit is contained in:
@@ -126,6 +126,13 @@ var form_handlers = function (el) {
|
|||||||
controls.value = currentValue <= itemOrderMin && step < 0 ? 0 : Math.max(itemOrderMin || controls.min, Math.min(controls.max || Number.MAX_SAFE_INTEGER, (currentValue || 0) + step));
|
controls.value = currentValue <= itemOrderMin && step < 0 ? 0 : Math.max(itemOrderMin || controls.min, Math.min(controls.max || Number.MAX_SAFE_INTEGER, (currentValue || 0) + step));
|
||||||
controls.dispatchEvent(new Event("change"));
|
controls.dispatchEvent(new Event("change"));
|
||||||
});
|
});
|
||||||
|
el.find("input[data-min]").on("blur", function(e) {
|
||||||
|
var quantity = parseFloat(this.value);
|
||||||
|
var itemOrderMin = parseFloat(this.getAttribute("data-min"));
|
||||||
|
if (quantity && quantity < itemOrderMin) {
|
||||||
|
this.value = itemOrderMin;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
el.find("script[data-replace-with-qr]").each(function () {
|
el.find("script[data-replace-with-qr]").each(function () {
|
||||||
var $div = $("<div>");
|
var $div = $("<div>");
|
||||||
|
|||||||
Reference in New Issue
Block a user