Skip to content

Commit

Permalink
Fixed javascript for nested ArrayListField
Browse files Browse the repository at this point in the history
  • Loading branch information
Zauberfisch committed Nov 6, 2018
1 parent 685f324 commit 1ef2508
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions javascript/ArrayListField.js
Original file line number Diff line number Diff line change
@@ -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({
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 1ef2508

Please sign in to comment.