diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2024-02-10 10:28:35 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2024-02-10 10:28:35 +0000 |
commit | f59ac49dea7b1e34fabb742eaff7d6f54f59fb43 (patch) | |
tree | dcecb7a0376c97534c05e90637f54a4771b54321 /config | |
parent | 759bececdd72af5d4b7d6b4e6f0f22a1de57ca31 (diff) | |
download | redmine-f59ac49dea7b1e34fabb742eaff7d6f54f59fb43.tar.gz redmine-f59ac49dea7b1e34fabb742eaff7d6f54f59fb43.zip |
Remove overrides that inserts a non-breaking space (nbsp) to empty option elements (#40210).
Patch by Go MAEDA (maeda).
git-svn-id: https://svn.redmine.org/redmine/trunk@22701 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/10-patches.rb | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/config/initializers/10-patches.rb b/config/initializers/10-patches.rb index 1d932eb1f..20d442add 100644 --- a/config/initializers/10-patches.rb +++ b/config/initializers/10-patches.rb @@ -34,20 +34,8 @@ end ActionView::Base.field_error_proc = Proc.new{ |html_tag, instance| html_tag || ''.html_safe } -# HTML5: <option value=""></option> is invalid, use <option value=""> </option> instead module ActionView module Helpers - module Tags - SelectRenderer.prepend(Module.new do - def add_options(option_tags, options, value = nil) - if options.delete(:include_blank) - options[:prompt] = ' '.html_safe - end - super - end - end) - end - module FormHelper alias :date_field_without_max :date_field def date_field(object_name, method, options = {}) @@ -56,29 +44,11 @@ module ActionView end module FormTagHelper - alias :select_tag_without_non_empty_blank_option :select_tag - def select_tag(name, option_tags = nil, options = {}) - if options.delete(:include_blank) - options[:prompt] = ' '.html_safe - end - select_tag_without_non_empty_blank_option(name, option_tags, options) - end - alias :date_field_tag_without_max :date_field_tag def date_field_tag(name, value = nil, options = {}) date_field_tag_without_max(name, value, options.reverse_merge(max: '9999-12-31')) end end - - module FormOptionsHelper - alias :options_for_select_without_non_empty_blank_option :options_for_select - def options_for_select(container, selected = nil) - if container.is_a?(Array) - container = container.map {|element| element.presence || [" ".html_safe, ""]} - end - options_for_select_without_non_empty_blank_option(container, selected) - end - end end end |