Skip to content

Commit 9f8b0af

Browse files
committed
Send the selected SDO to cc its liaison manager. See ietf-tools#345
- Legacy-Id: 2361
1 parent 251b161 commit 9f8b0af

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

static/js/liaisons.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
return this.each(function () {
44
var form = $(this);
55
var organization = form.find('#id_organization');
6+
var from = form.find('#id_from_field');
67
var poc = form.find('#id_to_poc');
78
var cc = form.find('#id_cc1');
89
var reply = form.find('#id_replyto');
10+
var purpose = form.find('#id_purpose');
911
var config = {};
1012

1113
var readConfig = function() {
@@ -24,15 +26,15 @@
2426
};
2527

2628
var updatePOC = function() {
27-
var organization = $(this).find('option:selected');
29+
var entity = organization.find('option:selected');
2830
var url = config.poc_update_url;
2931
$.ajax({
3032
url: url,
3133
type: 'GET',
3234
cache: false,
3335
async: true,
3436
dataType: 'json',
35-
data: {entity_id: organization.val()},
37+
data: {entity_id: entity.val()},
3638
success: function(response){
3739
if (!response.error) {
3840
render_mails_into(poc, response.poc);
@@ -43,15 +45,17 @@
4345
};
4446

4547
var updateCC = function() {
46-
var organization = $(this).find('option:selected');
48+
var entity = organization.find('option:selected');
49+
var sdo = from.find('option:selected');
4750
var url = config.cc_update_url;
4851
$.ajax({
4952
url: url,
5053
type: 'GET',
5154
cache: false,
5255
async: true,
5356
dataType: 'json',
54-
data: {to_entity_id: organization.val()},
57+
data: {to_entity_id: organization.val(),
58+
sdo_id: sdo.val()},
5559
success: function(response){
5660
if (!response.error) {
5761
render_mails_into(cc, response.cc);
@@ -69,11 +73,14 @@
6973
var initTriggers = function() {
7074
organization.change(updatePOC);
7175
organization.change(updateCC);
76+
from.change(updateCC);
7277
reply.keyup(updateFrom);
7378
};
7479

7580
var updateOnInit = function() {
7681
updateFrom();
82+
updateCC();
83+
updatePOC();
7784
};
7885

7986
var initForm = function() {

0 commit comments

Comments
 (0)