From 79621b6c7fd2ad04ab689f89fe9335ca22133ba9 Mon Sep 17 00:00:00 2001 From: Will Rossiter Date: Wed, 6 May 2009 04:11:34 +0000 Subject: [PATCH] MINOR: make sure field dropdowns are updated when adding a field --- javascript/UserForm.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/javascript/UserForm.js b/javascript/UserForm.js index c1c0e1f..d760ad0 100644 --- a/javascript/UserForm.js +++ b/javascript/UserForm.js @@ -60,7 +60,7 @@ var name = $("#Fields_fields li.EditableFormField:last").attr("id").split(' '); $("#Fields_fields select.fieldOption").each(function(i, domElement) { - $(domElement).append("New "+ name[2] + ""); + $(domElement).append(""); }); }, @@ -253,7 +253,7 @@ * Adding a custom rule to a given form */ $(".customRules .addCondition").livequery('click', function() { - + // Give the user some feedback statusMessage(ss.i18n._t('UserForms.ADDINGNEWRULE', 'Adding New Rule')); @@ -268,15 +268,16 @@ currentName[2] = currentRules.children().size() + 1; domElement.name = currentName.join("]["); }); + // remove hidden tag newRule.removeClass("hidden"); // update the fields dropdown newRule.children("select.fieldOption").empty(); - + $("#Fields_fields li.EditableFormField").each(function (i, domElement) { - var name = $(this).attr("id").split(' '); - newRule.children("select.fieldOption").append(""); + var name = $(domElement).attr("id").split(' '); + newRule.children("select.fieldOption").append(""); }); // append to the list