From 2562bc5bcd0c03320b4005c7a3d2a55795e9363a Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Sat, 19 Jun 2010 19:51:43 +0000 Subject: [PATCH] Hide the role forms when editing or adding Project members. #5452 Contributed by Yuki Kita git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3784 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/members_controller.rb | 8 +++++++- public/javascripts/application.js | 6 ++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index a84cf50db..795709a48 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -43,6 +43,7 @@ class MembersController < ApplicationController format.js { render(:update) {|page| page.replace_html "tab-content-members", :partial => 'projects/settings/members' + page << 'hideOnLoad()' members.each {|member| page.visual_effect(:highlight, "member-#{member.id}") } } } @@ -69,6 +70,7 @@ class MembersController < ApplicationController format.js { render(:update) {|page| page.replace_html "tab-content-members", :partial => 'projects/settings/members' + page << 'hideOnLoad()' page.visual_effect(:highlight, "member-#{@member.id}") } } @@ -82,7 +84,11 @@ class MembersController < ApplicationController end respond_to do |format| format.html { redirect_to :controller => 'projects', :action => 'settings', :tab => 'members', :id => @project } - format.js { render(:update) {|page| page.replace_html "tab-content-members", :partial => 'projects/settings/members'} } + format.js { render(:update) {|page| + page.replace_html "tab-content-members", :partial => 'projects/settings/members' + page << 'hideOnLoad()' + } + } end end diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 745125047..612739f5c 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -226,8 +226,10 @@ Ajax.Responders.register({ } }); -Event.observe(window, 'load', function() { +function hideOnLoad() { $$('.hol').each(function(el) { el.hide(); }); -}); +} + +Event.observe(window, 'load', hideOnLoad);