summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-09 18:46:37 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-09 18:46:37 +0000
commitc23e497c424a102c05fbdb7218b2a9af141b30e9 (patch)
treeda0a35009d5e5f2131b631a2a2296a4d8ffb07d8 /app
parent1b1c510ff99cfca216082926e5ce9e2e981b2506 (diff)
downloadredmine-c23e497c424a102c05fbdb7218b2a9af141b30e9.tar.gz
redmine-c23e497c424a102c05fbdb7218b2a9af141b30e9.zip
Avoid an AJAX query if the watchers form is already loaded.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8593 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/controllers/watchers_controller.rb1
-rw-r--r--app/views/watchers/_watchers.html.erb3
2 files changed, 3 insertions, 1 deletions
diff --git a/app/controllers/watchers_controller.rb b/app/controllers/watchers_controller.rb
index 1a1935d0d..8a4ce5286 100644
--- a/app/controllers/watchers_controller.rb
+++ b/app/controllers/watchers_controller.rb
@@ -42,6 +42,7 @@ class WatchersController < ApplicationController
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
diff --git a/app/views/watchers/_watchers.html.erb b/app/views/watchers/_watchers.html.erb
index 1f40707be..29cf7539b 100644
--- a/app/views/watchers/_watchers.html.erb
+++ b/app/views/watchers/_watchers.html.erb
@@ -5,7 +5,8 @@
:action => 'new',
:object_type => watched.class.name.underscore,
:object_id => watched},
- :method => 'get' %>
+ :method => 'get',
+ :before => "if ($('ajax-modal').hasClassName('new-watcher')) {showModal('ajax-modal'); return false;}" %>
</div>
<% end %>