{% extends "Theme/Users/User/layoutbase.html.twig" %}
{% block meta %}
{{ parent() }}
<meta name="keywords" content="{{ site }}, "/>
<meta name="author" content="Noel Kenfack"/>
<meta name="description" content="{{ site }}" />
{% endblock %}
{% block title %}
{{ parent() }} - Détails du service ..
{% endblock %}
{% block stylesheets %}
{{ parent() }}
{% endblock %}
{% block userblog_body %}
<section style="height: 500px;">
</section>
{% endblock %}
{% block javascripttemplate %}
button = document.querySelector('button.filter-select');
datalist = document.querySelector('datalist#text_editors');
select = document.querySelector('select.select-input');
options = select.options;
/* on arrow button click, show/hide the DDL*/
button.addEventListener('click', toggle_ddl);
function toggle_ddl() {
if (datalist.style.display === '') {
datalist.style.display = 'block';
this.textContent = "▲";
/* If input already has a value, select that option from DDL */
var val = input.value;
for (var i = 0; i < options.length; i++){
if (options[i].text === val){
select.selectedIndex = i;
break;
}
}
} else hide_select();
}
/* when user selects an option from DDL, write it to text field */
select.addEventListener('change', fill_input);
function fill_input() {
input.value = options[this.selectedIndex].value;
//alert(options[this.selectedIndex].getAttribute('data-value'))
document.location.href= ''+options[this.selectedIndex].getAttribute('data-value');
hide_select();
}
/* when user wants to type in text field, hide DDL */
input = document.querySelector('input#filter-select-input');
input.addEventListener('focus', hide_select);
function hide_select() {
datalist.style.display = '';
button.textContent = "▼";
}
input.addEventListener('change', change_select);
function change_select(){
var val = input.value;
for (var i = 0; i < options.length; i++) {
if (options[i].text === val) {
//alert(options[i].getAttribute('data-value'))
document.location.href= ''+options[i].getAttribute('data-value');
break;
}
}
}
{% endblock %}