Handle hotkeys if a dialog is up, or a dropdown is showing.

master
Pacman Ghost 5 years ago
parent cdc0ce68d1
commit c76dea3ab3
  1. 8
      vasl_templates/webapp/static/main.js
  2. 1
      vasl_templates/webapp/static/utils.js

@ -474,6 +474,14 @@ function init_hotkeys()
jQuery.hotkeys.options.filterTextInputs = false ;
function set_focus_to( tab, $ctrl ) {
if ( $(".ui-widget-overlay").length > 0 )
return ; // nb: a dialog is up
if ( $( ".select2-dropdown" ).length > 0 ) {
// FUDGE! A select2 dropdown is showing, but which one? We just close them all :-/
$( ".app-select2" ).each( function() {
$(this).select2( "close" ) ;
} ) ;
}
var curr_tab = $("#tabs .ui-tabs-active a").attr( "href" ) ;
if ( curr_tab !== tab )
$("#tabs .ui-tabs-nav a[href='"+tab+"']").trigger( "click" ) ;

@ -287,6 +287,7 @@ function init_select2( $sel, width, search_box, format )
}
$sel = $sel.select2( args ) ;
$sel.data( "select2" ).$container.attr( "name", name ) ;
$sel.addClass( "app-select2" ) ;
return $sel ;
}

Loading…
Cancel
Save