diff --git a/vasl_templates/webapp/data/default-scenario.json b/vasl_templates/webapp/data/default-scenario.json index 09f52f6..8235de2 100644 --- a/vasl_templates/webapp/data/default-scenario.json +++ b/vasl_templates/webapp/data/default-scenario.json @@ -3,11 +3,7 @@ "SCENARIO_THEATER": "ETO", "PLAYER_1": "german", -"PLAYER_1_ELR": "5", -"PLAYER_1_SAN": "2", "PLAYER_2": "russian", -"PLAYER_2_ELR": "5", -"PLAYER_2_SAN": "2", "VICTORY_CONDITIONS_WIDTH": "300px", "SSR_WIDTH": "300px", diff --git a/vasl_templates/webapp/static/main.js b/vasl_templates/webapp/static/main.js index 7c5064c..f85ccb4 100644 --- a/vasl_templates/webapp/static/main.js +++ b/vasl_templates/webapp/static/main.js @@ -231,15 +231,16 @@ $(document).ready( function () { } ) ; // load the ELR's and SAN's - var buf = [] ; + buf = [ "" ] ; // nb: to help the user to remember to set this for ( var i=0 ; i <= 5 ; ++i ) // nb: A19.1: ELR is 0-5 buf.push( "" ) ; buf = buf.join( "" ) ; var player_no, $sel ; for ( player_no=1 ; player_no <= 2 ; ++player_no ) { - init_select2( $( "select[name='PLAYER_" + player_no + "_ELR']" ), + $sel = init_select2( $( "select[name='PLAYER_" + player_no + "_ELR']" ), "3em", false, null ).html( buf ) ; + $sel.data( "select2" ).$results.css( "max-height", "15em" ) ; } buf = [ "" ] ; // nb: allow scenarios that have no SAN for ( i=2 ; i <= 7 ; ++i ) // nb: A14.1: SAN is 2-7 diff --git a/vasl_templates/webapp/static/snippets.js b/vasl_templates/webapp/static/snippets.js index fbfdbb8..437c57b 100644 --- a/vasl_templates/webapp/static/snippets.js +++ b/vasl_templates/webapp/static/snippets.js @@ -1944,7 +1944,7 @@ function reset_scenario() var player_no ; for ( player_no=1 ; player_no <= 2 ; ++player_no ) { on_player_change( player_no ) ; - $("select[name='PLAYER_" + player_no + "_ELR']").val( 0 ).trigger( "change" ) ; + $("select[name='PLAYER_" + player_no + "_ELR']").val( "" ).trigger( "change" ) ; $("select[name='PLAYER_" + player_no + "_SAN']").val( "" ).trigger( "change" ) ; } diff --git a/vasl_templates/webapp/tests/fixtures/data/default-scenario.json b/vasl_templates/webapp/tests/fixtures/data/default-scenario.json index 3a0ba63..7eee713 100644 --- a/vasl_templates/webapp/tests/fixtures/data/default-scenario.json +++ b/vasl_templates/webapp/tests/fixtures/data/default-scenario.json @@ -3,11 +3,6 @@ "SCENARIO_THEATER": "ETO", "PLAYER_1": "german", -"PLAYER_1_ELR": "5", -"PLAYER_1_SAN": "2", - -"PLAYER_2": "russian", -"PLAYER_2_ELR": "5", -"PLAYER_2_SAN": "2" +"PLAYER_2": "russian" } diff --git a/vasl_templates/webapp/tests/test_scenario_persistence.py b/vasl_templates/webapp/tests/test_scenario_persistence.py index 8435c91..c31206c 100644 --- a/vasl_templates/webapp/tests/test_scenario_persistence.py +++ b/vasl_templates/webapp/tests/test_scenario_persistence.py @@ -163,9 +163,9 @@ def test_scenario_persistence( webapp, webdriver ): #pylint: disable=too-many-st data2 = { k: v for k,v in data.items() if not k.startswith("_") and v } assert data2 == { "SCENARIO_THEATER": "ETO", - "PLAYER_1": "german", "PLAYER_1_ELR": "5", "PLAYER_1_SAN": "2", + "PLAYER_1": "german", "OB_VEHICLES_MA_NOTES_WIDTH_1": "300px", "OB_ORDNANCE_MA_NOTES_WIDTH_1": "300px", - "PLAYER_2": "russian", "PLAYER_2_ELR": "5", "PLAYER_2_SAN": "2", + "PLAYER_2": "russian", "OB_VEHICLES_MA_NOTES_WIDTH_2": "300px", "OB_ORDNANCE_MA_NOTES_WIDTH_2": "300px", }