diff options
Diffstat (limited to 'python/Dawn/static')
| -rw-r--r-- | python/Dawn/static/dawn.js | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/python/Dawn/static/dawn.js b/python/Dawn/static/dawn.js index 646db989..143947c8 100644 --- a/python/Dawn/static/dawn.js +++ b/python/Dawn/static/dawn.js @@ -1,5 +1,5 @@ var index_list = []; -var bbg_map = {'CDX': ["IG", "HY"], 'ITRX': ["EUR", "XOVER"]} +var bbg_map = {'CDX': ["IG", "HY"], 'ITRX': ["EUR", "XOVER"]}; var series_map = {'CDX': ["24", "25", "26", "27", "28", "29", "30", "31"], 'ITRX': ["24", "25", "26", "27", "28", "29", "30"]}; var index_tenor = ["3Y", "5Y", "7Y", "10Y"]; @@ -26,10 +26,11 @@ $(function() { }); }); $('#swap_type').change(function() { + var to_hide, to_show; switch ($(this).val()) { case 'CD_INDEX_TRANCHE': - var to_show = ['attach', 'detach', 'initial_margin_percentage', - 'index_ref', 'corr_attach', 'corr_detach']; + to_show = ['attach', 'detach', 'initial_margin_percentage', + 'index_ref', 'corr_attach', 'corr_detach']; to_show.forEach(function(id) { $('#' + id).parent().parent().css('display', 'block'); }); @@ -38,19 +39,21 @@ $(function() { $('#clearing_facility').parent().parent().css('display', 'none'); $('#clearing_facility').val(''); $('#initial_margin_percentage').parent().parent().css('display', 'block'); + $('#account_code').parent().parent().css('display', 'none'); break; case 'CD_INDEX': - var to_hide = ['attach', 'detach', 'initial_margin_percentage', - 'corr_attach', 'corr_detach', 'index_ref']; + to_hide = ['attach', 'detach', 'initial_margin_percentage', + 'corr_attach', 'corr_detach', 'index_ref']; to_hide.forEach(function(id) { $('#' + id).parent().parent().css('display', 'none'); }); $('#clearing_facility').parent().parent().css('display', 'block'); $('#clearing_facility').val('ICE-CREDIT'); + $('#account_code').parent().parent().css('display', 'block'); break; case 'ABS_CDS': - var to_hide = ['attach', 'detach', - 'corr_attach', 'corr_detach', 'index_ref']; + to_hide = ['attach', 'detach', + 'corr_attach', 'corr_detach', 'index_ref']; to_hide.forEach(function(id) { $('#' + id).parent().parent().css('display', 'none'); }); @@ -59,8 +62,8 @@ $(function() { $('#clearing_facility').val(''); break; case 'CD_BASKET_TRANCHE': - var to_show = ['attach', 'detach', 'initial_margin_percentage', - 'corr_attach', 'corr_detach', 'index_ref']; + to_show = ['attach', 'detach', 'initial_margin_percentage', + 'corr_attach', 'corr_detach', 'index_ref']; to_show.forEach(function(id) { $('#' + id).parent().parent().css('display', 'block'); }); @@ -68,8 +71,8 @@ $(function() { $('#clearing_facility').val(''); break; case 'SWAPTION': - var to_hide = ['fixed_rate', 'index_ref', 'security_desc', - 'corr_attach', 'corr_detach']; + to_hide = ['fixed_rate', 'index_ref', 'security_desc', + 'corr_attach', 'corr_detach']; to_hide.forEach(function(id) { $('#' + id).parent().parent().css('display', 'none'); }); @@ -77,8 +80,8 @@ $(function() { $('#settlement_type').val('Cash'); break; case 'CD_INDEX_OPTION': - var to_hide = ['attach', 'detach', - 'corr_attach', 'corr_detach']; + to_hide = ['attach', 'detach', + 'corr_attach', 'corr_detach']; to_hide.forEach(function(id) { $('#' + id).parent().parent().css('display', 'none'); }); |
