Skip to content

Commit

Permalink
Merge pull request #52 from ishikawa999/task/50
Browse files Browse the repository at this point in the history
Fix problem with search box not displaying after switching languages
  • Loading branch information
ishikawa999 committed Jun 3, 2022
2 parents 4fc662e + 2e0b57b commit d63ccd1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
8 changes: 7 additions & 1 deletion app/views/custom_message_settings/_messages.html.erb
Expand Up @@ -12,7 +12,13 @@ $(document).ready(function() {
setSelect2();
});

let currentSearchKeyword;
// Fix a problem with focus not working in Redmine 5.0 or later.
// issue: https://github.com/select2/select2/issues/5993
$(document).on('select2:open', function() {
document.querySelector('.select2-search__field').focus();
});

var currentSearchKeyword;
$('#key-selector').on('select2:select', function (e) {
var key = e.params.data.id;
var val = e.params.data.text;
Expand Down
1 change: 1 addition & 0 deletions app/views/custom_message_settings/edit.js.erb
@@ -1,3 +1,4 @@
$('#edit-custom-messages').html("<%= j (render 'custom_message_settings/messages', lang: @lang) %>");
$('#default-messages-link').replaceWith('<%= open_default_messages_window_link(@lang) %>')
setSelect2();
$('#ajax-indicator').hide();
2 changes: 1 addition & 1 deletion assets/stylesheets/custom_messages.css
Expand Up @@ -26,7 +26,7 @@
text-decoration: none;
}

.select2-container--default .select2-results__option span.key {
.select2-container--default .select2-results__option:not(.select2-results__option--highlighted) span.key {
color: gray;
}
.select2-container--default .select2-results__option[aria-disabled=true] {
Expand Down
2 changes: 1 addition & 1 deletion init.rb
Expand Up @@ -5,7 +5,7 @@

p = Redmine::Plugin.register :redmine_message_customize do
name 'Redmine message customize plugin'
version '0.1.3'
version '0.1.4'
description 'This is a plugin that allows messages in Redmine to be overwritten from the admin view'
settings default: { custom_messages: {} }
menu :admin_menu, :custom_messages, { controller: 'custom_message_settings', action: 'edit' },
Expand Down

0 comments on commit d63ccd1

Please sign in to comment.