mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-06-28 15:39:22 +02:00
bugfix + enhancement to support modeladmin
Update to allow UserDefinedForm pages to be managed through ModelAdmin. * Needed to update the ID of the form. * Bug on the form data serialisation (missing ampersand breaks security token.)
This commit is contained in:
parent
17bc3bce93
commit
45a3131caa
|
@ -116,10 +116,12 @@
|
||||||
*/
|
*/
|
||||||
$('div.FieldEditor .MenuHolder .action').entwine({
|
$('div.FieldEditor .MenuHolder .action').entwine({
|
||||||
onclick: function(e) {
|
onclick: function(e) {
|
||||||
var form = $("#Form_EditForm"),
|
var theform = $("#Form_EditForm"); // edit from page
|
||||||
|
if ( theform.length < 1 ) theform = $("#Form_ItemEditForm"); // edit from modeladmin
|
||||||
|
var form = theform,
|
||||||
length = $(".FieldInfo").length + 1,
|
length = $(".FieldInfo").length + 1,
|
||||||
fieldType = $(this).siblings("select").val(),
|
fieldType = $(this).siblings("select").val(),
|
||||||
formData = form.serialize()+'NewID='+ length +"&Type="+ fieldType,
|
formData = form.serialize()+'&NewID='+ length +"&Type="+ fieldType,
|
||||||
fieldEditor = $(this).closest('.FieldEditor');
|
fieldEditor = $(this).closest('.FieldEditor');
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user