mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
Merge pull request #272 from mikeyc7m/patch-1
Allow CMS javascript to work within ModelAdmin
This commit is contained in:
commit
31822a5c08
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user