From 658862fca70193526d4bbc13286115e03c2b7850 Mon Sep 17 00:00:00 2001 From: sboursen-scinote Date: Thu, 19 Jan 2023 15:36:34 +0100 Subject: [PATCH] Refactor using delegated event [SCI-7745] --- app/assets/javascripts/experiments/table.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/experiments/table.js b/app/assets/javascripts/experiments/table.js index 190876293..6b046540b 100644 --- a/app/assets/javascripts/experiments/table.js +++ b/app/assets/javascripts/experiments/table.js @@ -230,12 +230,12 @@ var ExperimnetTable = { return true; }; - $('#modal-edit-module').on('click', 'button[data-action="confirm"]', handleRenameModal); - - $('#modal-edit-module').find('form').submit((e) => { - e.preventDefault(); - handleRenameModal(); - }); + $('#modal-edit-module') + .on('click', 'button[data-action="confirm"]', handleRenameModal) + .on('submit', 'form', (e) => { + e.preventDefault(); + handleRenameModal(); + }); }, initManageUsersDropdown: function() { $(this.table).on('show.bs.dropdown', '.assign-users-dropdown', (e) => {