From 32fa0100bf82af6cb63254a16babc6bf7344b5ed Mon Sep 17 00:00:00 2001 From: Taka Date: Mon, 12 Oct 2020 11:44:38 +0000 Subject: [PATCH] Set initial focus in dialogs. --- vasl_templates/webapp/static/roar.js | 2 +- vasl_templates/webapp/static/user_settings.js | 2 +- vasl_templates/webapp/static/vo.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vasl_templates/webapp/static/roar.js b/vasl_templates/webapp/static/roar.js index 01237eb..9086e9f 100644 --- a/vasl_templates/webapp/static/roar.js +++ b/vasl_templates/webapp/static/roar.js @@ -75,7 +75,7 @@ window.selectRoarScenario = function( onSelected ) }, open: function() { // initialize - on_dialog_open( $(this) ) ; + on_dialog_open( $(this), $(this).find("select[type='search']") ) ; $sel.select2( "open" ) ; // update the UI onResize( $(this) ) ; diff --git a/vasl_templates/webapp/static/user_settings.js b/vasl_templates/webapp/static/user_settings.js index f40a5ec..2b68a4c 100644 --- a/vasl_templates/webapp/static/user_settings.js +++ b/vasl_templates/webapp/static/user_settings.js @@ -119,7 +119,7 @@ function user_settings( on_ok, caption ) } }, open: function() { - on_dialog_open( $(this) ) ; + on_dialog_open( $(this), $(this).find("input[name='vasl-username']") ) ; // FUDGE! Doing this in the "open" handler breaks loading the scenario-images-source droplist :shrug: // FIXME! Using select2 breaks Ctrl-Enter handling :-( $(this).find( "select" ).select2( { minimumResultsForSearch: -1 } ) ; diff --git a/vasl_templates/webapp/static/vo.js b/vasl_templates/webapp/static/vo.js index 2b1954b..6083bd3 100644 --- a/vasl_templates/webapp/static/vo.js +++ b/vasl_templates/webapp/static/vo.js @@ -99,7 +99,7 @@ function add_vo( vo_type, player_no ) }, open: function() { // initialize - on_dialog_open( $(this) ) ; + on_dialog_open( $(this), $(this).find("select[type='search']") ) ; add_flag_to_dialog_titlebar( $(this), get_player_no_for_element($sortable2) ) ; $sel.select2( "open" ) ; // set the titlebar color