We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f6cc0fe commit e4a1570Copy full SHA for e4a1570
vendor/assets/javascripts/jquery_nested_form.js
@@ -39,7 +39,7 @@ jQuery(function($) {
39
40
// Make a unique ID for the new child
41
var regexp = new RegExp('new_' + assoc, 'g');
42
- var new_id = new Date().getTime();
+ var new_id = this.newId();
43
content = content.replace(regexp, new_id);
44
45
var field = this.insertFields(content, assoc, link);
@@ -49,6 +49,9 @@ jQuery(function($) {
49
.trigger({ type: 'nested:fieldAdded:' + assoc, field: field });
50
return false;
51
},
52
+ newId: function() {
53
+ return new Date().getTime();
54
+ },
55
insertFields: function(content, assoc, link) {
56
return $(content).insertBefore(link);
57
0 commit comments