From a0970e2b8d46c8f958fa6885e4a1015337a98e9d Mon Sep 17 00:00:00 2001 From: Rusty Burchfield Date: Wed, 18 Mar 2009 10:51:27 -0700 Subject: [PATCH] Fix :method and :confirm in IE7. --- actionpack/lib/action_view/helpers/url_helper.rb | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb index 36e0a78..e02d567 100644 --- a/actionpack/lib/action_view/helpers/url_helper.rb +++ b/actionpack/lib/action_view/helpers/url_helper.rb @@ -300,7 +300,7 @@ module ActionView end if confirm = html_options.delete("confirm") - html_options["onclick"] = "return #{confirm_javascript_function(confirm)};" + html_options["onclick"] = "result = #{confirm_javascript_function(confirm)};event.returnValue = result;return result;" end url = options.is_a?(String) ? options : self.url_for(options) @@ -566,15 +566,15 @@ module ActionView when popup && method raise ActionView::ActionViewError, "You can't use :popup and :method in the same link" when confirm && popup - "if (#{confirm_javascript_function(confirm)}) { #{popup_javascript_function(popup)} };return false;" + "if (#{confirm_javascript_function(confirm)}) { #{popup_javascript_function(popup)} };event.returnValue = false;return false;" when confirm && method - "if (#{confirm_javascript_function(confirm)}) { #{method_javascript_function(method)} };return false;" + "if (#{confirm_javascript_function(confirm)}) { #{method_javascript_function(method)} };event.returnValue = false;return false;" when confirm - "return #{confirm_javascript_function(confirm)};" + "result = #{confirm_javascript_function(confirm)};event.returnValue = result;return result;" when method - "#{method_javascript_function(method, url, href)}return false;" + "#{method_javascript_function(method, url, href)}event.returnValue = false;return false;" when popup - "#{popup_javascript_function(popup)}return false;" + "#{popup_javascript_function(popup)}event.returnValue = false;return false;" else html_options["onclick"] end -- 1.5.4.3