Skip to content

Commit

Permalink
Fix DOM text reinterpretation issue (#3456)
Browse files Browse the repository at this point in the history
  • Loading branch information
junlarsen committed Mar 22, 2022
1 parent 7c03aae commit b72ede0
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions static/noscript.ts
Expand Up @@ -36,16 +36,15 @@ $(document).on('ready', () => {
span.remove();
const option = container.find('input');
option.addClass('d-none');
const button = $(`
<button
title="${option.attr('title')}"
aria-pressed=${option.attr('checked') === 'checked' ? 'true' : 'false'}
data-bind="${option.attr('name')}"
type="button"
class="dropdown-item btn btn-sm btn-light">
</button>`
);

const button = $('<button />');
button.addClass('dropdown-item btn btn-sm btn-light');
button.attr('type', 'button');
button.attr('title', option.attr('title') ?? '');
button.data('bind', option.attr('name') ?? '');
button.attr('aria-pressed', option.attr('checked') === 'checked' ? 'true' : 'false');
button.append(span);

container.prepend(button);
const parent = container.parent();
parent.removeClass('noscriptdropdown');
Expand Down

0 comments on commit b72ede0

Please sign in to comment.