aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Whiteland <dave@mysociety.org>2012-07-05 16:46:30 +0100
committerDave Whiteland <dave@mysociety.org>2012-07-05 16:46:30 +0100
commit2b6907e5ab0a894907e9e12b073672584be87477 (patch)
treea10e77b353dc12cd396f852d7b129e5b9b6928d4
parent848797fda5402cf78a139a6aba82100aad97cf8b (diff)
pass the MM message ID into FMS on submit, if there is one
-rw-r--r--templates/web/fixmybarangay/around/tabbed_lists.html9
1 files changed, 9 insertions, 0 deletions
diff --git a/templates/web/fixmybarangay/around/tabbed_lists.html b/templates/web/fixmybarangay/around/tabbed_lists.html
index 6a358475a..4f96e0b5d 100644
--- a/templates/web/fixmybarangay/around/tabbed_lists.html
+++ b/templates/web/fixmybarangay/around/tabbed_lists.html
@@ -51,13 +51,16 @@ $(document).ready(function() {
var mm_selected_message = function(data) {
var msg_text = "";
+ var msg_id = "";
if (data['success']) {
msg_text = data['data']['Message']['message'];
+ msg_id = data['data']['Message']['id'];
// $('#form_detail').val( $('input[name=mm_text]:checked').val() );
} else {
$('input[name=mm_text]').prop('checked', false); // uncheck all
}
$('#form_detail').val(msg_text);
+ $('#form_mm_msg_id').val(msg_id);
}
message_manager.config({url_root: "http://dave.message-manager.dev.mysociety.org/"});
@@ -69,6 +72,12 @@ $(document).ready(function() {
message_manager.get_available_messages({callback:mm_populate_list});
});
+ // problem form hidden input "form_mm_msg_id": pass the MM id into FMS, if used
+ $('<input type="hidden"/>').attr({
+ 'id': 'form_mm_msg_id',
+ 'name': 'form_mm_msg_id',
+ }).appendTo($('#problem_form'));
+
$('#available-submit').click();
/*