Pārlūkot izejas kodu

修复表单弹窗编辑页面新增按钮点击无效问题

jqh 5 gadi atpakaļ
vecāks
revīzija
04e7dace51
1 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 2 2
      src/Form/Field/HasMany.php

+ 2 - 2
src/Form/Field/HasMany.php

@@ -480,7 +480,7 @@ class HasMany extends Field
          * {count} is increment number of current sub form count.
          */
         $script = <<<JS
-(function () {
+setTimeout(function () {
     var nestedIndex = 0;
     
     {$this->makeReplaceNestedIndexScript()}
@@ -500,7 +500,7 @@ $('#has-many-{$this->column}').on('click', '.remove', function () {
     $(this).closest('.has-many-{$this->column}-form').hide();
     $(this).closest('.has-many-{$this->column}-form').find('.$removeClass').val(1);
 });
-})();
+}, 1)
 JS;
 
         Admin::script($script);