app/Plugin/ProductOption42/Resource/template/admin/Product/product_list.js line 1

Open in your IDE?
  1. <script>
  2.     $(function() {
  3.         var index = 6;
  4.         $('table th').each(function(i) {
  5.             if($(this).text().match(/{{'admin.product.stock'|trans}}/)){
  6.                 index = i;
  7.             }
  8.         });
  9.         $('table tr').each(function(i) {
  10.             if (i != 0) {
  11.                 $elem = $('#p' + i);
  12.                 $elem2 = $('#pr' + i);
  13.                 if($elem.length !== 0){
  14.                     $('td:eq('+index+')', this).after('<td class="align-middle"><a href="'+ $elem.text() +'"><button type="button" class="btn page-link text-dark d-inline-block">{{ 'productoption.admin.product.list.option.label.assign'|trans }}</button></a><br><a href="'+ $elem2.text() +'"><button type="button" style="margin-top:2px;" class="btn page-link text-dark d-inline-block">{{ 'productoption.admin.product.list.option.label.sort'|trans }}</button></a></td>');
  15.                     $elem.remove();
  16.                     $elem2.remove();
  17.                 }
  18.             } else {
  19.                 $elem = $('#productoption_text');
  20.                 if($elem.length !== 0){
  21.                     $('th:eq('+index+')', this).after('<th class="border-top-0 pt-2 pb-2">'+ $elem.text() +'</th>');
  22.                     $elem.remove();
  23.                 }
  24.             }
  25.         });
  26.     });
  27. </script>