From 2154faeb974547ea9c74e308b18c732e3b41d14d Mon Sep 17 00:00:00 2001 From: Taka Date: Sat, 26 Jan 2019 08:59:45 +0000 Subject: [PATCH] Allow Ctrl-Enter to dismiss the USER SETTINGS dialog. --- vasl_templates/webapp/static/user_settings.js | 3 ++- vasl_templates/webapp/static/utils.js | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/vasl_templates/webapp/static/user_settings.js b/vasl_templates/webapp/static/user_settings.js index fcbdcf7..e36a4e6 100644 --- a/vasl_templates/webapp/static/user_settings.js +++ b/vasl_templates/webapp/static/user_settings.js @@ -46,9 +46,10 @@ function user_settings() height: 250, resizable: false, create: function() { - init_dialog( $(this), "OK", false ) ; + init_dialog( $(this), "OK", true ) ; }, open: function() { + on_dialog_open( $(this) ) ; // load the current user settings load_settings( $(this) ) ; }, diff --git a/vasl_templates/webapp/static/utils.js b/vasl_templates/webapp/static/utils.js index 183db02..b4a3049 100644 --- a/vasl_templates/webapp/static/utils.js +++ b/vasl_templates/webapp/static/utils.js @@ -148,10 +148,16 @@ function init_dialog( $dlg, ok_button_text, auto_dismiss ) // allow Ctrl-Enter to dismiss the dialog if ( auto_dismiss ) { - $dlg.find("input[type='text']").keydown( function(evt) { + $dlg.find( "input[type='text']" ).keydown( function(evt) { auto_dismiss_dialog( $dlg, evt, ok_button_text ) ; } ) ; - $dlg.find("textarea").keydown( function(evt) { + $dlg.find( "input[type='checkbox']" ).keydown( function(evt) { + auto_dismiss_dialog( $dlg, evt, ok_button_text ) ; + } ) ; + $dlg.find( "select" ).keydown( function(evt) { + auto_dismiss_dialog( $dlg, evt, ok_button_text ) ; + } ) ; + $dlg.find( "textarea" ).keydown( function(evt) { auto_dismiss_dialog( $dlg, evt, ok_button_text ) ; } ) ; }