summaryrefslogtreecommitdiffstats
path: root/app/controllers/watchers_controller.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-07-19 17:17:10 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-07-19 17:17:10 +0000
commit38060a2cf0132a702c91adf60f344ad28c4e8e00 (patch)
tree217c5f7885a9c48ab8c006d4ba84862ee91e141d /app/controllers/watchers_controller.rb
parentc178aded61c24b6037cd2dc403161427c8c0f836 (diff)
downloadredmine-38060a2cf0132a702c91adf60f344ad28c4e8e00.tar.gz
redmine-38060a2cf0132a702c91adf60f344ad28c4e8e00.zip
Removes RJS from WatchersController.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10047 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers/watchers_controller.rb')
-rw-r--r--app/controllers/watchers_controller.rb41
1 files changed, 4 insertions, 37 deletions
diff --git a/app/controllers/watchers_controller.rb b/app/controllers/watchers_controller.rb
index b6fe5e594..a0be20faf 100644
--- a/app/controllers/watchers_controller.rb
+++ b/app/controllers/watchers_controller.rb
@@ -33,15 +33,6 @@ class WatchersController < ApplicationController
end
def new
- respond_to do |format|
- format.js do
- render :update do |page|
- page.replace_html 'ajax-modal', :partial => 'watchers/new', :locals => {:watched => @watched}
- page << "showModal('ajax-modal', '400px');"
- page << "$('ajax-modal').addClassName('new-watcher');"
- end
- end
- end
end
def create
@@ -53,29 +44,14 @@ class WatchersController < ApplicationController
end
respond_to do |format|
format.html { redirect_to_referer_or {render :text => 'Watcher added.', :layout => true}}
- format.js do
- render :update do |page|
- page.replace_html 'ajax-modal', :partial => 'watchers/new', :locals => {:watched => @watched}
- page.replace_html 'watchers', :partial => 'watchers/watchers', :locals => {:watched => @watched}
- end
- end
+ format.js
end
end
def append
if params[:watcher].is_a?(Hash)
user_ids = params[:watcher][:user_ids] || [params[:watcher][:user_id]]
- users = User.active.find_all_by_id(user_ids)
- respond_to do |format|
- format.js do
- render :update do |page|
- users.each do |user|
- page << %|$$("#issue_watcher_user_ids_#{user.id}").each(function(el){el.remove();});|
- end
- page.insert_html :bottom, 'watchers_inputs', :text => watchers_checkboxes(nil, users, true)
- end
- end
- end
+ @users = User.active.find_all_by_id(user_ids)
end
end
@@ -83,11 +59,7 @@ class WatchersController < ApplicationController
@watched.set_watcher(User.find(params[:user_id]), false) if request.post?
respond_to do |format|
format.html { redirect_to :back }
- format.js do
- render :update do |page|
- page.replace_html 'watchers', :partial => 'watchers/watchers', :locals => {:watched => @watched}
- end
- end
+ format.js
end
end
@@ -117,12 +89,7 @@ private
@watched.set_watcher(user, watching)
respond_to do |format|
format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}}
- format.js do
- render(:update) do |page|
- c = watcher_css(@watched)
- page << %|$$(".#{c}").each(function(el){el.innerHTML="#{escape_javascript watcher_link(@watched, user)}"});|
- end
- end
+ format.js { render :partial => 'set_watcher', :locals => {:user => user, :watched => @watched} }
end
end
end