mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 15:05:42 +00:00
MINOR: make sure field dropdowns are updated when adding a field
This commit is contained in:
parent
3ec7345ac9
commit
79621b6c7f
@ -60,7 +60,7 @@
|
|||||||
var name = $("#Fields_fields li.EditableFormField:last").attr("id").split(' ');
|
var name = $("#Fields_fields li.EditableFormField:last").attr("id").split(' ');
|
||||||
|
|
||||||
$("#Fields_fields select.fieldOption").each(function(i, domElement) {
|
$("#Fields_fields select.fieldOption").each(function(i, domElement) {
|
||||||
$(domElement).append("<option='"+ name[2] +"'>New "+ name[2] + "</option>");
|
$(domElement).append("<option value='"+ name[2] +"'>New "+ name[2] + "</option>");
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -268,6 +268,7 @@
|
|||||||
currentName[2] = currentRules.children().size() + 1;
|
currentName[2] = currentRules.children().size() + 1;
|
||||||
domElement.name = currentName.join("][");
|
domElement.name = currentName.join("][");
|
||||||
});
|
});
|
||||||
|
|
||||||
// remove hidden tag
|
// remove hidden tag
|
||||||
newRule.removeClass("hidden");
|
newRule.removeClass("hidden");
|
||||||
|
|
||||||
@ -275,8 +276,8 @@
|
|||||||
newRule.children("select.fieldOption").empty();
|
newRule.children("select.fieldOption").empty();
|
||||||
|
|
||||||
$("#Fields_fields li.EditableFormField").each(function (i, domElement) {
|
$("#Fields_fields li.EditableFormField").each(function (i, domElement) {
|
||||||
var name = $(this).attr("id").split(' ');
|
var name = $(domElement).attr("id").split(' ');
|
||||||
newRule.children("select.fieldOption").append("<option value='"+ name[2] + "'>"+ $(domElement).children(".fieldInfo .text").val() + "</option>");
|
newRule.children("select.fieldOption").append("<option value='"+ name[2] + "'>"+ $(domElement).find(".text").val() + "</option>");
|
||||||
});
|
});
|
||||||
|
|
||||||
// append to the list
|
// append to the list
|
||||||
|
Loading…
x
Reference in New Issue
Block a user