Fix helper to merge style option correctly
This commit is contained in:
@@ -11,7 +11,7 @@ module GlobalizeHelper
|
||||
end
|
||||
|
||||
def display_translation?(locale)
|
||||
same_locale?(neutral_locale(I18n.locale), neutral_locale(locale)) ? "" : "display: none"
|
||||
same_locale?(neutral_locale(I18n.locale), neutral_locale(locale)) ? "" : "display: none;"
|
||||
end
|
||||
|
||||
def translation_enabled_tag(locale, enabled)
|
||||
@@ -19,7 +19,7 @@ module GlobalizeHelper
|
||||
end
|
||||
|
||||
def css_to_display_translation?(resource, locale)
|
||||
enable_locale?(resource, locale) ? "" : "display: none"
|
||||
enable_locale?(resource, locale) ? "" : "display: none;"
|
||||
end
|
||||
|
||||
def enable_locale?(resource, locale)
|
||||
|
||||
@@ -4,6 +4,6 @@ module SiteCustomizationHelper
|
||||
end
|
||||
|
||||
def site_customization_display_translation?(locale)
|
||||
site_customization_enable_translation?(locale) ? "" : "display: none"
|
||||
site_customization_enable_translation?(locale) ? "" : "display: none;"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -15,11 +15,11 @@ module TranslatableFormHelper
|
||||
def merge_translatable_field_options(options, locale)
|
||||
options.merge(
|
||||
class: "#{options[:class]} js-globalize-attribute".strip,
|
||||
style: display_translation?(locale),
|
||||
style: "#{options[:style]} #{display_translation?(locale)}".strip,
|
||||
data: options.fetch(:data, {}).merge(locale: locale),
|
||||
label_options: {
|
||||
class: "#{options.dig(:label_options, :class)} js-globalize-attribute".strip,
|
||||
style: display_translation?(locale),
|
||||
style: "#{options.dig(:label_options, :style)} #{display_translation?(locale)}".strip,
|
||||
data: (options.dig(:label_options, :data) || {}) .merge(locale: locale)
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user