Prevent "Remove" from removing the last html input for options

with multiple values.
This commit is contained in:
Anders Betnér 2006-05-27 17:30:11 +00:00
parent 0285f0bdc0
commit 5d29ec0dbd

View File

@ -271,14 +271,11 @@ var Config = {
Effect.BlindDown(newSpan,{duration: 0.2}); Effect.BlindDown(newSpan,{duration: 0.2});
}, },
_removeItemEvent: function (e) { _removeItemEvent: function (e) {
var div = Event.element(e); var div = Event.element(e).parentNode;
while (div.nodeName.toLowerCase() != 'div') {
div = div.parentNode;
}
Config._removeItem(div); Config._removeItem(div);
}, },
_removeItem: function(div,noAnimation) { _removeItem: function(div,noAnimation) {
if (div.parentNode.childNodes.length > 1) { if (div.parentNode.getElementsByTagName('input').length > 1) {
if (noAnimation) { if (noAnimation) {
// cancelForm uses a loop to delete elements, the loop can't wait // cancelForm uses a loop to delete elements, the loop can't wait
// for Effect.BlindUp to finish // for Effect.BlindUp to finish