[FIX] website_event: unblock button when no reserve
In 11.0, this changee9454e79solved 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 backportse9454e79and solves the 0 ticket registration. opw-1851622 closes #24966
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user