diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 2d9d339a4c..b83fe7b3f6 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1033,9 +1033,9 @@ module ApplicationHelper def javascript_heads tags = javascript_include_tag(:defaults) unless User.current.pref.warn_on_leaving_unsaved == '0' - tags << "\n" + javascript_tag("Event.observe(window, 'load', function(){ new WarnLeavingUnsaved('#{escape_javascript( l(:text_warn_on_leaving_unsaved) )}'); });") + tags.safe_concat "\n" + javascript_tag("Event.observe(window, 'load', function(){ new WarnLeavingUnsaved('#{escape_javascript( l(:text_warn_on_leaving_unsaved) )}'); });") end - tags << "\n" + javascript_include_tag("accessibility.js") if User.current.impaired? and accessibility_js_enabled? + tags.safe_concat("\n" + javascript_include_tag("accessibility.js")) if User.current.impaired? and accessibility_js_enabled? tags end