From fef32fac36800b6033367827ff45905db1d261c7 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 25 Oct 2018 17:17:50 -0300 Subject: [PATCH] Bug 21645: Fix focus when modal is shown First the event must be defined in the document.ready block, then, since bootstrap 3 the event is 'shown.bs.modal', not 'shown' Signed-off-by: Jonathan Druart Signed-off-by: Nick Clemens --- .../prog/en/modules/admin/library_groups.tt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/library_groups.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/library_groups.tt index bcf77af6ea..48263ddd8e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/library_groups.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/library_groups.tt @@ -269,6 +269,12 @@ var parent_title = $(this).data('groupParentTitle'); remove_library( id, library, parent_title ); }); + $('#add-group-modal').on('shown.bs.modal', function() { + $('#add-group-modal-title').focus(); + }); + $('#edit-group-modal').on('shown.bs.modal', function() { + $('#edit-group-modal-title').focus(); + }); }); function add_group( parent_id ) { @@ -277,9 +283,6 @@ $('#add-group-modal-description').val(""); $('#add-group-modal-title').val(""); - $('#add-group-modal').on('shown', function() { - $('#add-group-modal-title').focus(); - }); $('#add-group-modal-ft_hide_patron_info').prop('checked', false); $('#add-group-modal-ft_search_groups_opac').prop('checked', false); @@ -290,6 +293,7 @@ $('#root-group-features-add').show(); } $('#add-group-modal').modal('show'); + } function edit_group( id, parent_id, title, description, ft_hide_patron_info, ft_search_groups_opac, ft_search_groups_staff ) { @@ -309,10 +313,6 @@ $('#root-group-features-edit').show(); } - $('#edit-group-modal').on('shown', function() { - $('#edit-group-modal-title').focus(); - }); - $('#edit-group-modal').modal('show'); } -- 2.39.5