Commit c486c236 authored by Christodoulos Psaltis's avatar Christodoulos Psaltis
Browse files

Trap keydown event on add metadata dialog, #375

parent 2f56a91f
......@@ -661,6 +661,19 @@ function show_metadata_add_dialog() {
return false;
}
// trapping keydown event
jQuery.expr[':'].focus = function( elem ) {
return elem === document.activeElement && ( elem.type || elem.href );
};
$('*').keydown(function (){
if ($('#add-dialog').is(":visible") && !($('input.key').is(':focus') || $('textarea.value').is(':focus'))){
$('input.key').focus();
$('input.key').focusin();
}
return true;
});
// intercept click on create button in metadata edit dialog
$('#edit-dialog.meta-modal button.create').click( function(){
// close edit metadata and open add metadata dialog
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment