Преглед на файлове

Trigger sonata-admin-append-form-element event on collection form type

Emmanuel Vella преди 11 години
родител
ревизия
8272cf1917
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      Resources/public/base.js

+ 4 - 1
Resources/public/base.js

@@ -170,7 +170,10 @@ var Admin = {
             var parts = container.attr('id').split('_');
             var nameRegexp = new RegExp(parts[parts.length-1]+'\\]\\['+protoName,'g');
             proto = proto.replace(nameRegexp, parts[parts.length-1]+']['+(container.children().length - 1));
-            jQuery(proto).insertBefore(jQuery(this).parent());
+            jQuery(proto)
+                .insertBefore(jQuery(this).parent())
+                .trigger('sonata-admin-append-form-element')
+            ;
 
             jQuery(this).trigger('sonata-collection-item-added');
         });