parent
62688539e7
commit
349de37c7d
@ -48,6 +48,11 @@
|
|||||||
{% include "agenda_culturel/single-event/event-single-inc.html" with event=object noedit=1 %}
|
{% include "agenda_culturel/single-event/event-single-inc.html" with event=object noedit=1 %}
|
||||||
</article>
|
</article>
|
||||||
<script>
|
<script>
|
||||||
|
function htmlDecode(str) {
|
||||||
|
const doc = new DOMParser().parseFromString(str, "text/html");
|
||||||
|
return doc.documentElement.textContent;
|
||||||
|
}
|
||||||
|
|
||||||
const element = document.querySelector('#id_place');
|
const element = document.querySelector('#id_place');
|
||||||
const choices = new Choices(element, {
|
const choices = new Choices(element, {
|
||||||
searchResultLimit: 10,
|
searchResultLimit: 10,
|
||||||
@ -57,7 +62,7 @@
|
|||||||
choices.showDropdown();
|
choices.showDropdown();
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const searchTerm = '{{ object.location }}';
|
const searchTerm = htmlDecode('{{ object.location }}');
|
||||||
choices.input.focus();
|
choices.input.focus();
|
||||||
choices.input.value = searchTerm;
|
choices.input.value = searchTerm;
|
||||||
choices._handleSearch(searchTerm);
|
choices._handleSearch(searchTerm);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user