From 5d29ec0dbd2786db58a17a1411ed3eed68c3ecaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Betn=C3=A9r?= Date: Sat, 27 May 2006 17:30:11 +0000 Subject: [PATCH] Prevent "Remove" from removing the last html input for options with multiple values. --- admin-root/config.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/admin-root/config.js b/admin-root/config.js index a55f2d73..4ce5c58a 100644 --- a/admin-root/config.js +++ b/admin-root/config.js @@ -271,14 +271,11 @@ var Config = { Effect.BlindDown(newSpan,{duration: 0.2}); }, _removeItemEvent: function (e) { - var div = Event.element(e); - while (div.nodeName.toLowerCase() != 'div') { - div = div.parentNode; - } + var div = Event.element(e).parentNode; Config._removeItem(div); }, _removeItem: function(div,noAnimation) { - if (div.parentNode.childNodes.length > 1) { + if (div.parentNode.getElementsByTagName('input').length > 1) { if (noAnimation) { // cancelForm uses a loop to delete elements, the loop can't wait // for Effect.BlindUp to finish