diff --git a/js/src/database/routines.js b/js/src/database/routines.js index 826a826c7510..443d7fbc73f1 100644 --- a/js/src/database/routines.js +++ b/js/src/database/routines.js @@ -9,7 +9,7 @@ AJAX.registerTeardown('database/routines.js', function () { $(document).off('change', 'select[name=item_type]'); $(document).off('change', 'select[name^=item_param_type]'); $(document).off('change', 'select[name=item_returntype]'); - $(document).off('click', 'input[name=routine_addparameter]'); + $(document).off('click', '#addRoutineParameterButton'); $(document).off('click', 'a.routine_param_remove_anchor'); }); @@ -526,8 +526,6 @@ const DatabaseRoutines = { var that = this; // Make adjustments in the dialog to make it AJAX compatible $('td.routine_param_remove').show(); - $('input[name=routine_removeparameter]').remove(); - $('input[name=routine_addparameter]').css('width', '100%'); // Enable/disable the 'options' dropdowns for parameters as necessary $('table.routine_params_table').last().find('th[colspan=2]').attr('colspan', '1'); $('table.routine_params_table').last().find('tr').has('td').each(function () { @@ -923,7 +921,7 @@ AJAX.registerOnload('database/routines.js', function () { ); }); - $(document).on('click', 'input[name=routine_addparameter]', function (event) { + $(document).on('click', '#addRoutineParameterButton', function (event) { event.preventDefault(); /** * @var routine_params_table jQuery object containing the reference diff --git a/templates/database/routines/editor_form.twig b/templates/database/routines/editor_form.twig index 51c6fa85561c..19731066032b 100644 --- a/templates/database/routines/editor_form.twig +++ b/templates/database/routines/editor_form.twig @@ -1,4 +1,4 @@ -
+ {% if is_edit_mode %} @@ -63,8 +63,12 @@ - - + {% if is_ajax %} + + {% else %} + + + {% endif %} diff --git a/test/classes/Database/RoutinesTest.php b/test/classes/Database/RoutinesTest.php index 071e3fe25474..4b8b9639a0b4 100644 --- a/test/classes/Database/RoutinesTest.php +++ b/test/classes/Database/RoutinesTest.php @@ -760,11 +760,7 @@ public function providerGetEditorForm3(): array ], [ $data, - 'name="routine_addparameter"', - ], - [ - $data, - 'name="routine_removeparameter"', + 'id="addRoutineParameterButton"', ], [ $data,