aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Whiteland <dave@mysociety.org>2013-02-15 18:23:31 +0000
committerDave Whiteland <dave@mysociety.org>2013-02-15 18:23:31 +0000
commitdf913eebf8ce0962a825c7f6d58e682433a61d60 (patch)
tree74b1c405e6c33be3bde1206566dce6820206f7b8
parent5277e0c376341e2b5b669d9033b467cfcfc47c7a (diff)
FixMyBarangay: allow boilerplate strings to act like prefix or suffix, closes MM #166
-rw-r--r--templates/web/fixmybarangay/report/_message_manager.html4
1 files changed, 3 insertions, 1 deletions
diff --git a/templates/web/fixmybarangay/report/_message_manager.html b/templates/web/fixmybarangay/report/_message_manager.html
index 2860689be..b0ae18671 100644
--- a/templates/web/fixmybarangay/report/_message_manager.html
+++ b/templates/web/fixmybarangay/report/_message_manager.html
@@ -173,7 +173,9 @@ $(document).ready(function() {
$('#reason_text').val($(this).val()); // load reason_text with boilerplate reason
});
$('#mm-boilerplate-replies').change(function(e){
- $('#reply_text').val($(this).val()); // load reason_text with boilerplate reason
+ var old_txt = $('#reply_text').val();
+ var new_txt = $(this).val().replace(/(^\.\.\.|\.\.\.$)/, old_txt);
+ $('#reply_text').val(new_txt); // load reply_text with boilerplate reason
});
$('#reply-submit').click(function(e) {