escaping html in dropdowns

This commit is contained in:
antelle 2020-04-17 20:28:03 +02:00
parent cbb9a29c8d
commit 38c3a46395
No known key found for this signature in database
GPG Key ID: 094A2F2D6136A4EE
2 changed files with 9 additions and 3 deletions

View File

@ -135,7 +135,7 @@ class ListSearchView extends View {
setLocale() {
this.sortOptions.forEach(opt => {
opt.text = opt.loc();
opt.html = opt.loc();
});
const entryDesc = Features.isMobile
? ''
@ -145,7 +145,7 @@ class ListSearchView extends View {
Shortcuts.altShortcutSymbol(true) +
'N)</span>';
this.createOptions = [
{ value: 'entry', icon: 'key', text: StringFormat.capFirst(Locale.entry) + entryDesc },
{ value: 'entry', icon: 'key', html: StringFormat.capFirst(Locale.entry) + entryDesc },
{ value: 'group', icon: 'folder', text: StringFormat.capFirst(Locale.group) }
];
if (this.el) {

View File

@ -2,7 +2,13 @@
{{#each options as |option|}}
<div class="dropdown__item {{#if option.active}}dropdown__item--active{{/if}}" data-value="{{option.value}}">
<i class="fa fa-{{option.icon}} dropdown__item-icon"></i>
<span class="dropdown__item-text">{{{option.text}}}</span>
<span class="dropdown__item-text">
{{~#if option.text~}}
{{option.text}}
{{~else~}}
{{{option.html}}}
{{~/if~}}
</span>
</div>
{{/each}}
</div>