aboutsummaryrefslogtreecommitdiff
path: root/p/scripts
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-10-10 22:08:30 +0200
committerGravatar GitHub <noreply@github.com> 2016-10-10 22:08:30 +0200
commitcdd01c3d28ef091004e3907e2616d3052516e573 (patch)
tree99474af6a3199d0944b294c592fec4fc78dfe4b9 /p/scripts
parentc5c3011edfb93662cf1208ff38a26a781634c998 (diff)
parentcbb6c26db79b5a74e588110d2cf8fc8cf9137ab8 (diff)
Merge pull request #1300 from Alkarex/share-string-replace-global
Fix bug share
Diffstat (limited to 'p/scripts')
-rw-r--r--p/scripts/main.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/p/scripts/main.js b/p/scripts/main.js
index 3c0a36629..d42704f7a 100644
--- a/p/scripts/main.js
+++ b/p/scripts/main.js
@@ -1153,10 +1153,10 @@ function init_share_observers() {
$('.share.add').on('click', function(e) {
var opt = $(this).siblings('select').find(':selected');
var row = $(this).parents('form').data(opt.data('form'));
- row = row.replace('##label##', opt.html().trim(), 'g');
- row = row.replace('##type##', opt.val(), 'g');
- row = row.replace('##help##', opt.data('help'), 'g');
- row = row.replace('##key##', shares, 'g');
+ row = row.replace(/##label##/g, opt.html().trim());
+ row = row.replace(/##type##/g, opt.val());
+ row = row.replace(/##help##/g, opt.data('help'));
+ row = row.replace(/##key##/g, shares);
$(this).parents('.form-group').before(row);
shares++;