Skip to content

Commit f710fc1

Browse files
committed
Replaces in right place
1 parent f8fbad8 commit f710fc1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/assets/javascripts/cocoon.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
if (typeof pnew_id == "string" || typeof pnew_id == "number") {
6868
new_content = content.replace(regexp_inputid,
6969
'$& value="' + pnew_id + '" ');
70-
new_content = content.replace(regexp_inputid2,
70+
new_content = new_content.replace(regexp_inputid2,
7171
'$& value="' + pnew_id + '" ');
7272
new_id = pnew_id;
7373
} else {
@@ -78,7 +78,7 @@
7878
new_id = pnew_id[assoc]
7979
new_content = content.replace(regexp_inputid,
8080
'$& value="' + new_id + '" ');
81-
new_content = content.replace(regexp_inputid2,
81+
new_content = new_content.replace(regexp_inputid2,
8282
'$& value="' + new_id + '" ');
8383
for (var i in pnew_id) {
8484
if (i != assoc) {

0 commit comments

Comments
 (0)