Skip to content

Commit f44468b

Browse files
bdalsasssteffunky
andauthored
N°8245 - External key not saved in n-n link in edition (#703)
* 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 a756f9b. --------- Co-authored-by: Stephen Abello <stephen.abello@combodo.com>
1 parent 7af1cde commit f44468b

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

js/links/links_widget.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -390,16 +390,17 @@ function LinksWidget(id, sClass, sAttCode, iInputId, sSuffix, bDuplicates, oWizH
390390

391391
this.RegisterChange = function () {
392392
// Listen only used inputs
393-
$('#linkedset_'+me.id+' :input[name^="attr_'+me.sAttCode+'["]').off('change').on('change', function () {
393+
$('body').off('change', '#linkedset_'+me.id+' :input[name^="attr_'+me.sAttCode+'["]')
394+
.on('change', '#linkedset_'+me.id+' :input[name^="attr_'+me.sAttCode+'["]', function () {
394395
if (!($(this).hasClass('selection')))
395-
{
396-
let oCheckbox = $(this).closest('tr').find('.selection');
397-
let iLink = oCheckbox.attr('data-link-id');
398-
let iUniqueId = oCheckbox.attr('data-unique-id');
399-
let sAttCode = $(this).closest('.attribute-edit').attr('data-attcode');
400-
let value = $(this).val();;
401-
return me.OnValueChange(iLink, iUniqueId, sAttCode, value, this);
402-
}
396+
{
397+
let oCheckbox = $(this).closest('tr').find('.selection');
398+
let iLink = oCheckbox.attr('data-link-id');
399+
let iUniqueId = oCheckbox.attr('data-unique-id');
400+
let sAttCode = $(this).closest('.attribute-edit').attr('data-attcode');
401+
let value = $(this).val();;
402+
return me.OnValueChange(iLink, iUniqueId, sAttCode, value, this);
403+
}
403404
return true;
404405
});
405406
};

0 commit comments

Comments
 (0)