Merge pull request #272 from mikeyc7m/patch-1

Allow CMS javascript to work within ModelAdmin
This commit is contained in:
Will Rossiter 2015-07-01 09:57:39 +12:00
commit 31822a5c08
1 changed files with 5 additions and 3 deletions

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);