From 1ef2508e230cb34bee5e5dfeb7f76f7e8c536a53 Mon Sep 17 00:00:00 2001 From: Zauberfisch Date: Tue, 6 Nov 2018 14:48:54 +0000 Subject: [PATCH] Fixed javascript for nested ArrayListField --- javascript/ArrayListField.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; }