Clear a player's description when their nationality is changed.

master
Pacman Ghost 3 years ago
parent 1c7cabb73e
commit a4108c8256
  1. 5
      vasl_templates/webapp/static/main.js
  2. 2
      vasl_templates/webapp/tests/test_snippets.py

@ -717,11 +717,10 @@ function is_player_ob_empty( player_no )
function on_player_change( player_no )
{
// update the tab label
// update the UI
var player_nat = update_ob_tab_header( player_no ) ;
// show/hide the nationality-specific buttons
update_nationality_specific_buttons( player_no ) ;
$( "input[name='PLAYER_" + player_no + "_DESCRIPTION']" ).val( "" ) ;
// show/hide the vehicle/ordnance multi-applicable notes controls
function update_ma_notes_controls( vo_type ) {

@ -218,7 +218,7 @@ def test_players_snippets( webapp, webdriver ):
_test_snippet( btn, {
"PLAYER_1": "british",
},
"player1=[british:British] ; ELR=[1] ; SAN=[2] ; description=[Froggy Army]" \
"player1=[british:British] ; ELR=[1] ; SAN=[2] ; description=[]" \
" | player2=[british:British] ; ELR=[3] ; SAN=[4] ; description=[Barmy Army]",
[ "Both players have the same nationality!" ],
)

Loading…
Cancel
Save