templates/Theme/Produit/Service/Article/detailArticle.html.twig line 1

Open in your IDE?
  1. {% extends "Theme/Users/User/layoutbase.html.twig" %}
  2. {% block meta %}
  3.     {{ parent() }}
  4.     <meta name="keywords" content="{{ site }}, "/>
  5.     <meta name="author" content="Noel Kenfack"/>
  6.     <meta name="description" content="{{ site }}" />
  7. {% endblock %}
  8. {% block title %}
  9.     {{ parent() }} - Détails du service ..
  10. {% endblock %}
  11. {% block stylesheets %}
  12.     {{ parent() }}
  13. {% endblock %}
  14. {% block userblog_body %}
  15.     <section style="height: 500px;">
  16.     </section>
  17. {% endblock %}
  18. {% block javascripttemplate %}
  19. button = document.querySelector('button.filter-select');
  20. datalist = document.querySelector('datalist#text_editors');
  21. select = document.querySelector('select.select-input');
  22. options = select.options;
  23. /* on arrow button click, show/hide the DDL*/
  24. button.addEventListener('click', toggle_ddl);
  25. function toggle_ddl() {
  26.   if (datalist.style.display === '') {
  27.     datalist.style.display = 'block';
  28.     this.textContent = "▲";
  29.     /* If input already has a value, select that option from DDL */
  30.     var val = input.value;
  31.     for (var i = 0; i < options.length; i++){
  32.       if (options[i].text === val){
  33.         select.selectedIndex = i;
  34.         break;
  35.       }
  36.     }
  37.   } else hide_select();
  38. }
  39. /* when user selects an option from DDL, write it to text field */
  40. select.addEventListener('change', fill_input);
  41. function fill_input() {
  42.   input.value = options[this.selectedIndex].value;
  43.   //alert(options[this.selectedIndex].getAttribute('data-value'))
  44.   document.location.href= ''+options[this.selectedIndex].getAttribute('data-value');
  45.   hide_select();
  46. }
  47. /* when user wants to type in text field, hide DDL */
  48. input = document.querySelector('input#filter-select-input');
  49. input.addEventListener('focus', hide_select);
  50. function hide_select() {
  51.   datalist.style.display = '';
  52.   button.textContent = "▼";
  53. }
  54. input.addEventListener('change', change_select);
  55. function change_select(){
  56.     var val = input.value;
  57.     for (var i = 0; i < options.length; i++) {
  58.       if (options[i].text === val) {
  59.         //alert(options[i].getAttribute('data-value'))
  60.         document.location.href= ''+options[i].getAttribute('data-value');
  61.         break;
  62.       }
  63.     }
  64. }
  65. {% endblock %}