diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-04-05 12:09:15 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-04-05 12:09:15 +0000 |
commit | e3dae9ddbf46353df67a1cc155de6b05a58bfa35 (patch) | |
tree | 2b9ceda31b34dac2d53743c2eb405a503e68306a /app/controllers | |
parent | 1af6527e427bcfeba189eac10c3642fa177dfa6e (diff) | |
download | redmine-e3dae9ddbf46353df67a1cc155de6b05a58bfa35.tar.gz redmine-e3dae9ddbf46353df67a1cc155de6b05a58bfa35.zip |
Cleaner way to handle the replacement of watch links (#8071).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5320 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/watchers_controller.rb | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/app/controllers/watchers_controller.rb b/app/controllers/watchers_controller.rb index ad8d8be22..7678d9cca 100644 --- a/app/controllers/watchers_controller.rb +++ b/app/controllers/watchers_controller.rb @@ -1,5 +1,5 @@ -# redMine - project management software -# Copyright (C) 2006-2007 Jean-Philippe Lang +# Redmine - project management software +# Copyright (C) 2006-2011 Jean-Philippe Lang # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -76,21 +76,13 @@ private def set_watcher(user, watching) @watched.set_watcher(user, watching) - if params[:replace].present? - if params[:replace].is_a? Array - replace_ids = params[:replace] - else - replace_ids = [params[:replace]] - end - else - replace_ids = ['watcher'] - end respond_to do |format| format.html { redirect_to :back } format.js do render(:update) do |page| - replace_ids.each do |replace_id| - page.replace_html replace_id, watcher_link(@watched, user, :replace => replace_ids) + c = watcher_css(@watched) + page.select(".#{c}").each do |item| + page.replace_html item, watcher_link(@watched, user) end end end |