templates/assets/assets_form_errors.html.twig line 1

Open in your IDE?
  1.   {% cache "assets-vuejs" ttl(86400) %}  
  2. {#    86400s = 1jour   #}
  3. <script>
  4.     window.onload = function () {
  5.         if (window.jQuery) {
  6.             $('input,select,textarea').on('input', function () {
  7.                 if ($(this).val()) {
  8.                     $(this).removeClass("is-invalid");
  9.                     let currentId = $(this).attr("id");
  10.                     if (currentId) {
  11.                         let items = currentId.split('_');
  12.                         if (items.length > 1) {
  13.                             items.shift();// supprimer le  premier
  14.                             let selectorItem = "div#" + items.join("_");
  15.                             if ($(selectorItem).length > 0) {
  16.                                 $(selectorItem).remove();
  17.                             } else {
  18.                                 items = selectorItem.split('_');
  19.                                 items.pop(); // supprimer le  dernier
  20.                                 selectorItem = items.join("_");
  21.                                 if ($(selectorItem).length > 0) {
  22.                                     $(selectorItem).remove();
  23.                                 }
  24.                             }
  25.                         }
  26.                     }
  27.                 }
  28.             });
  29.         } else {
  30.             // jQuery is not loaded
  31.         }
  32.     }
  33. </script>
  34.  {% endcache %}