瀏覽代碼

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;