diff --git a/admin/tool/dataprivacy/amd/build/effective_retention_period.min.js b/admin/tool/dataprivacy/amd/build/effective_retention_period.min.js index 48f7d3c9f82..1fba508e9a1 100644 --- a/admin/tool/dataprivacy/amd/build/effective_retention_period.min.js +++ b/admin/tool/dataprivacy/amd/build/effective_retention_period.min.js @@ -1 +1 @@ -define(["jquery"],function(a){var b={PURPOSE_SELECT:"#id_purposeid",RETENTION_FIELD_BOOST:"#id_error_retention_current",RETENTION_FIELD_CLEAN:"#fitem_id_retention_current [data-fieldtype=static]"},c=function(a){this.purposeRetentionPeriods=a,this.registerEventListeners()},d=function(){a(b.PURPOSE_SELECT).off("change")};return c.prototype.purposeRetentionPeriods=[],c.prototype.registerEventListeners=function(){a(b.PURPOSE_SELECT).on("change",function(c){var d=a(c.currentTarget).val(),e=this.purposeRetentionPeriods[d],f=a(b.RETENTION_FIELD_CLEAN);if(f.length>0)f.text(e);else{var g=a(b.RETENTION_FIELD_BOOST),h=g.siblings();h.length>0&&h.text(e)}}.bind(this))},{init:function(a){return d(),new c(a)}}}); \ No newline at end of file +define(["jquery"],function(a){var b={PURPOSE_SELECT:"#id_purposeid",RETENTION_FIELD:"#fitem_id_retention_current [data-fieldtype=static]"},c=function(a){this.purposeRetentionPeriods=a,this.registerEventListeners()},d=function(){a(b.PURPOSE_SELECT).off("change")};return c.prototype.purposeRetentionPeriods=[],c.prototype.registerEventListeners=function(){a(b.PURPOSE_SELECT).on("change",function(c){var d=a(c.currentTarget).val(),e=this.purposeRetentionPeriods[d];a(b.RETENTION_FIELD).text(e)}.bind(this))},{init:function(a){return d(),new c(a)}}}); \ No newline at end of file diff --git a/admin/tool/dataprivacy/amd/src/effective_retention_period.js b/admin/tool/dataprivacy/amd/src/effective_retention_period.js index 8d587ca2d23..7e3a1022f23 100644 --- a/admin/tool/dataprivacy/amd/src/effective_retention_period.js +++ b/admin/tool/dataprivacy/amd/src/effective_retention_period.js @@ -26,8 +26,7 @@ define(['jquery'], var SELECTORS = { PURPOSE_SELECT: '#id_purposeid', - RETENTION_FIELD_BOOST: '#id_error_retention_current', - RETENTION_FIELD_CLEAN: '#fitem_id_retention_current [data-fieldtype=static]', + RETENTION_FIELD: '#fitem_id_retention_current [data-fieldtype=static]', }; /** @@ -65,18 +64,7 @@ define(['jquery'], $(SELECTORS.PURPOSE_SELECT).on('change', function(ev) { var selected = $(ev.currentTarget).val(); var selectedPurpose = this.purposeRetentionPeriods[selected]; - - var cleanSelector = $(SELECTORS.RETENTION_FIELD_CLEAN); - if (cleanSelector.length > 0) { - cleanSelector.text(selectedPurpose); - } else { - var boostSelector = $(SELECTORS.RETENTION_FIELD_BOOST); - var retentionField = boostSelector.siblings(); - if (retentionField.length > 0) { - retentionField.text(selectedPurpose); - } - } - + $(SELECTORS.RETENTION_FIELD).text(selectedPurpose); }.bind(this)); };