diff --git a/app/views/issues/_didyoumean_injected.html.erb b/app/views/issues/_didyoumean_injected.html.erb index 8f985f8..1db885b 100644 --- a/app/views/issues/_didyoumean_injected.html.erb +++ b/app/views/issues/_didyoumean_injected.html.erb @@ -19,4 +19,4 @@ }; -<%= javascript_tag "observeIssueSubjectField('#{@project.id}', #{@issue.id or '\'\''}, '#{issues_didyoumean_event_type}');" %> +<%= javascript_tag "observeIssueSubjectField('#{@project.id}', #{@issue.id or '\'\''}, '#{Setting.plugin_redmine_didyoumean['start_search_when'] == "1" ? "keyup" : "change"}');" %> diff --git a/init.rb b/init.rb index 3379c1b..35a41ce 100644 --- a/init.rb +++ b/init.rb @@ -19,7 +19,4 @@ settings(:default => default_settings, :partial => 'settings/didyoumean_settings') end -ActionDispatch::Callbacks.to_prepare do - require 'redmine_didyoumean/hooks/didyoumean_hooks' - IssuesHelper.send :include, RedmineDidyoumean::Patches::SearchIssuesHelperPatch -end +require 'redmine_didyoumean/hooks/didyoumean_hooks' diff --git a/lib/redmine_didyoumean/patches/search_issues_helper_patch.rb b/lib/redmine_didyoumean/patches/search_issues_helper_patch.rb deleted file mode 100644 index 392e8a6..0000000 --- a/lib/redmine_didyoumean/patches/search_issues_helper_patch.rb +++ /dev/null @@ -1,13 +0,0 @@ -module RedmineDidyoumean - module Patches - module SearchIssuesHelperPatch - def issues_didyoumean_event_type - if Setting.plugin_redmine_didyoumean['start_search_when'] == "1" - "keyup" - else - "change" - end - end - end - end -end