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:
mikeyc7m 2015-06-30 15:10:20 +10:00
parent 17bc3bce93
commit 45a3131caa

View File

@ -116,10 +116,12 @@
*/
$('div.FieldEditor .MenuHolder .action').entwine({
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,
fieldType = $(this).siblings("select").val(),
formData = form.serialize()+'NewID='+ length +"&Type="+ fieldType,
formData = form.serialize()+'&NewID='+ length +"&Type="+ fieldType,
fieldEditor = $(this).closest('.FieldEditor');
e.preventDefault();
@ -348,4 +350,4 @@
});
});
});
})(jQuery);
})(jQuery);