From ad343f0dd6200af20d8e429340daf17c20f1d10d Mon Sep 17 00:00:00 2001 From: Oliver Tacke Date: Thu, 6 Jun 2024 12:38:52 +0200 Subject: [PATCH] Use removeItem for removeAllItems (list) --- scripts/h5peditor-list.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/scripts/h5peditor-list.js b/scripts/h5peditor-list.js index 01258ec1..7d36e8fa 100644 --- a/scripts/h5peditor-list.js +++ b/scripts/h5peditor-list.js @@ -238,15 +238,9 @@ H5PEditor.List = (function ($) { return; } - // Remove child fields - for (var i = 0; i < children.length; i++) { - children[i].remove(); + while (children.length) { + self.removeItem(0); } - children = []; - - // Clean up parameters - parameters = undefined; - setValue(field); }; /**