Skip to content

Commit

Permalink
Add 'djnesting:beforeadded' event. fixes #47
Browse files Browse the repository at this point in the history
  • Loading branch information
fdintino committed Sep 13, 2016
1 parent 02eb051 commit dfcfbdb
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions nested_admin/static/nested_admin/dist/nested_admin.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion nested_admin/static/nested_admin/dist/nested_admin.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions nested_admin/static/nested_admin/dist/nested_admin.min.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ class DjangoFormset {
var maxForms = this.mgmtVal('MAX_NUM_FORMS');
var isNested = this.$inline.hasClass('djn-group-nested');

$(document).trigger('djnesting:beforeadded', [this.$inline, $form]);

$form.removeClass(this.opts.emptyClass);
$form.addClass('djn-item');
$form.attr('id', $form.attr('id').replace('-empty', index));
Expand Down

0 comments on commit dfcfbdb

Please sign in to comment.