Skip to content

Commit

Permalink
Changed function name
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Dębiński committed Mar 19, 2024
1 parent ec0fdb3 commit b73d5ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/bundle/Resources/public/js/scripts/core/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
createSelectedItem(value, label, icon) {
const container = doc.createElement('div');
const selectedItemRendered = this.selectedItemTemplate
.replace('{{ value }}', ibexa.helpers.text.escapeDataset(value))
.replace('{{ value }}', ibexa.helpers.text.escapeHTMLAttribute(value))
.replace('{{ label }}', label);

container.insertAdjacentHTML('beforeend', selectedItemRendered);
Expand Down Expand Up @@ -396,7 +396,7 @@
createOption(value, label) {
const container = doc.createElement('div');
const itemRendered = this.itemTemplate
.replaceAll('{{ value }}', ibexa.helpers.text.escapeDataset(value))
.replaceAll('{{ value }}', ibexa.helpers.text.escapeHTMLAttribute(value))
.replaceAll('{{ label }}', label);

container.insertAdjacentHTML('beforeend', itemRendered);
Expand Down
4 changes: 2 additions & 2 deletions src/bundle/Resources/public/js/scripts/helpers/text.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
return stringTempNode.innerHTML;
};

const escapeDataset = (str) => {
const escapeHTMLAttribute = (str) => {
if (str === null) {
return '';
}
Expand All @@ -22,6 +22,6 @@

ibexa.addConfig('helpers.text', {
escapeHTML,
escapeDataset,
escapeHTMLAttribute,
});
})(window, window.document, window.ibexa);

0 comments on commit b73d5ca

Please sign in to comment.