Browse Source

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
tags/1.4.0
Jean-Philippe Lang 12 years ago
parent
commit
c23e497c42
2 changed files with 3 additions and 1 deletions
  1. 1
    0
      app/controllers/watchers_controller.rb
  2. 2
    1
      app/views/watchers/_watchers.html.erb

+ 1
- 0
app/controllers/watchers_controller.rb View File

@@ -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

+ 2
- 1
app/views/watchers/_watchers.html.erb View File

@@ -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 %>


Loading…
Cancel
Save