Skip to content
Snippets Groups Projects
Commit 66a60c70 authored by Nicolas Lempereur's avatar Nicolas Lempereur
Browse files

[FIX] website_event: unblock button when no reserve

In 11.0, this change e9454e79 solved the use case of:

- opening the registration of a ticket
- discard

=> the page must be reloaded to register a ticket

A new report is that since 9.0, if we try to register 0 ticket we would
also have to reload the page.

This commit backports e9454e79 and solves the 0 ticket registration.

opw-1851622
closes #24966
parent ea3b8955
Branches
Tags
No related merge requests found
......@@ -13,16 +13,23 @@ $(document).ready(function () {
ev.preventDefault();
ev.stopPropagation();
var $form = $(ev.currentTarget).closest('form');
var $button = $(this);
var post = {};
$("select").each(function() {
post[$(this)[0].name] = $(this).val();
});
ajax.jsonRpc($form.attr('action'), 'call', post).then(function (modal) {
// Only needed for 9.0 up to saas-14
if (modal === false) {
$button.prop('disabled', false);
return;
}
var $modal = $(modal);
$modal.find('.modal-body > div').removeClass('container'); // retrocompatibility - REMOVE ME in master / saas-19
$modal.after($form).modal();
$modal.insertAfter($form).modal();
$modal.on('click', '.js_goto_event', function () {
$modal.modal('hide');
$button.prop('disabled', false);
});
});
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment