From f44468b7a17139164dbb72f26b1ff98679f4e955 Mon Sep 17 00:00:00 2001 From: Benjamin Dalsass <95754414+bdalsass@users.noreply.github.com> Date: Mon, 24 Mar 2025 14:05:30 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B08245=20-=20External=20key=20not=20saved?= =?UTF-8?q?=20in=20n-n=20link=20in=20edition=20(#703)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * N°8245 - External key not saved in n-n link in edition * Remove the listener from the input element itself, put it on the body with a selector that matches our input * Revert "N°8245 - External key not saved in n-n link in edition" This reverts commit a756f9b1598599d6889d725e0e15a2287e8971ea. --------- Co-authored-by: Stephen Abello --- js/links/links_widget.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/js/links/links_widget.js b/js/links/links_widget.js index eaffcae21..1dbdde0fd 100644 --- a/js/links/links_widget.js +++ b/js/links/links_widget.js @@ -390,16 +390,17 @@ function LinksWidget(id, sClass, sAttCode, iInputId, sSuffix, bDuplicates, oWizH this.RegisterChange = function () { // Listen only used inputs - $('#linkedset_'+me.id+' :input[name^="attr_'+me.sAttCode+'["]').off('change').on('change', function () { + $('body').off('change', '#linkedset_'+me.id+' :input[name^="attr_'+me.sAttCode+'["]') + .on('change', '#linkedset_'+me.id+' :input[name^="attr_'+me.sAttCode+'["]', function () { if (!($(this).hasClass('selection'))) - { - let oCheckbox = $(this).closest('tr').find('.selection'); - let iLink = oCheckbox.attr('data-link-id'); - let iUniqueId = oCheckbox.attr('data-unique-id'); - let sAttCode = $(this).closest('.attribute-edit').attr('data-attcode'); - let value = $(this).val();; - return me.OnValueChange(iLink, iUniqueId, sAttCode, value, this); - } + { + let oCheckbox = $(this).closest('tr').find('.selection'); + let iLink = oCheckbox.attr('data-link-id'); + let iUniqueId = oCheckbox.attr('data-unique-id'); + let sAttCode = $(this).closest('.attribute-edit').attr('data-attcode'); + let value = $(this).val();; + return me.OnValueChange(iLink, iUniqueId, sAttCode, value, this); + } return true; }); };