diff --git a/javascript/ArrayListField.js b/javascript/ArrayListField.js index e1a5381..ef08b9c 100644 --- a/javascript/ArrayListField.js +++ b/javascript/ArrayListField.js @@ -1,7 +1,7 @@ (function ($) { $('.zauberfisch\\\\SerializedDataObject\\\\Form\\\\ArrayListField').entwine({ getRecordList: function () { - return this.find('.record-list'); + return this.find('> .middleColumn > div.CompositeField > .record-list'); } }); $('.zauberfisch\\\\SerializedDataObject\\\\Form\\\\ArrayListField *').entwine({ @@ -40,7 +40,7 @@ var field = this.getContainerField(), recordList = field.getRecordList(), _this = this, - newIndex = recordList.find('.record').length, + newIndex = recordList.find('> .record').length, url = field.data('add-record-url'); this.addClass('loading'); this.getRootForm().addClass('changed'); @@ -76,7 +76,7 @@ index = record.index(); if ( (index === 0 && this.hasClass('orderable-up')) || - (index === recordList.find('.record').length - 1 && this.hasClass('orderable-down')) + (index === recordList.find('> .record').length - 1 && this.hasClass('orderable-down')) ) { return false; }