Переглянути джерело

Merge pull request #2889 from EmmanuelVella/patch-22

Fix collection JS (again)
Thomas 10 роки тому
батько
коміт
00efb83103
1 змінених файлів з 2 додано та 2 видалено
  1. 2 2
      Resources/public/Admin.js

+ 2 - 2
Resources/public/Admin.js

@@ -342,9 +342,9 @@ var Admin = {
             var collection = jQuery(this);
             var counter = 0;
             collection.children().each(function() {
-                var matches = highestCounterRegexp.exec(jQuery(this).find('.form-control').attr('id'));
+                var matches = highestCounterRegexp.exec(jQuery('[id^="sonata-ba-field-container"]', this).attr('id'));
                 if (matches && matches[1] && matches[1] > counter) {
-                    counter = matches[1];
+                    counter = parseInt(matches[1], 10);
                 }
             });
             counters[collection.attr('id')] = counter;