From 4c6b9d9ce506253cae52bfc0d716bd67ecebb29f Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 14 May 2008 17:23:40 +0000 Subject: [PATCH] Fixed: Check All / Uncheck All in Email Settings doesn't work (#1180). git-svn-id: http://redmine.rubyforge.org/svn/trunk@1429 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/views/settings/_notifications.rhtml | 4 ++-- public/javascripts/application.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/views/settings/_notifications.rhtml b/app/views/settings/_notifications.rhtml index ac3213853..1a472d606 100644 --- a/app/views/settings/_notifications.rhtml +++ b/app/views/settings/_notifications.rhtml @@ -9,13 +9,13 @@ <%= hidden_field_tag 'settings[bcc_recipients]', 0 %>

-
<%=l(:text_select_mail_notifications)%> +
<%=l(:text_select_mail_notifications)%> <% @notifiables.each do |notifiable| %>
<% end %> <%= hidden_field_tag 'settings[notified_events][]', '' %> -

<%= check_all_links('mail-options-form') %>

+

<%= check_all_links('notified_events') %>

<%= l(:setting_emails_footer) %> diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 4e8849842..f3d771a10 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -2,10 +2,10 @@ Copyright (C) 2006-2008 Jean-Philippe Lang */ function checkAll (id, checked) { - var el = document.getElementById(id); - for (var i = 0; i < el.elements.length; i++) { - if (el.elements[i].disabled==false) { - el.elements[i].checked = checked; + var els = Element.descendants(id); + for (var i = 0; i < els.length; i++) { + if (els[i].disabled==false) { + els[i].checked = checked; } } } -- 2.39.5