Allow Ctrl-Enter to dismiss the USER SETTINGS dialog.

master
Pacman Ghost 5 years ago
parent c128209e7f
commit 2154faeb97
  1. 3
      vasl_templates/webapp/static/user_settings.js
  2. 10
      vasl_templates/webapp/static/utils.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) ) ;
},

@ -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 ) ;
} ) ;
}

Loading…
Cancel
Save