summaryrefslogtreecommitdiffstats
path: root/app/views/watchers
diff options
context:
space:
mode:
Diffstat (limited to 'app/views/watchers')
-rw-r--r--app/views/watchers/_new.html.erb12
-rw-r--r--app/views/watchers/_set_watcher.js.erb2
-rw-r--r--app/views/watchers/append.js.erb4
-rw-r--r--app/views/watchers/create.js.erb4
-rw-r--r--app/views/watchers/destroy.js.erb2
-rw-r--r--app/views/watchers/new.js.erb4
6 files changed, 10 insertions, 18 deletions
diff --git a/app/views/watchers/_new.html.erb b/app/views/watchers/_new.html.erb
index 013317aa0..eba0665b4 100644
--- a/app/views/watchers/_new.html.erb
+++ b/app/views/watchers/_new.html.erb
@@ -9,18 +9,10 @@
:id => 'new-watcher-form') do %>
<p><%= label_tag 'user_search', l(:label_user_search) %><%= text_field_tag 'user_search', nil %></p>
- <%= observe_field(:user_search,
- :frequency => 0.5,
- :update => :users_for_watcher,
- :method => :get,
- :before => '$("user_search").addClassName("ajax-loading")',
- :complete => '$("user_search").removeClassName("ajax-loading")',
- :url => {
- :controller => 'watchers',
+ <%= javascript_tag "observeSearchfield('user_search', 'users_for_watcher', '#{ escape_javascript url_for(:controller => 'watchers',
:action => 'autocomplete_for_user',
:object_type => watched.class.name.underscore,
- :object_id => watched},
- :with => 'q') %>
+ :object_id => watched) }')" %>
<div id="users_for_watcher">
<%= principals_check_box_tags 'watcher[user_ids][]', (watched ? watched.addable_watcher_users : User.active.all(:limit => 100)) %>
diff --git a/app/views/watchers/_set_watcher.js.erb b/app/views/watchers/_set_watcher.js.erb
index 4f2a4318b..6283a3805 100644
--- a/app/views/watchers/_set_watcher.js.erb
+++ b/app/views/watchers/_set_watcher.js.erb
@@ -1,2 +1,2 @@
<% selector = ".#{watcher_css(watched)}" %>
-$$("<%= selector %>").each(function(el){el.update("<%= escape_javascript watcher_link(watched, user) %>")});
+$("<%= selector %>").each(function(){$(this).html("<%= escape_javascript watcher_link(watched, user) %>")});
diff --git a/app/views/watchers/append.js.erb b/app/views/watchers/append.js.erb
index b5bde1e6d..934865dfb 100644
--- a/app/views/watchers/append.js.erb
+++ b/app/views/watchers/append.js.erb
@@ -1,4 +1,4 @@
<% @users.each do |user| %>
- $$("#issue_watcher_user_ids_<%= user.id %>").each(function(el){el.remove();});
+ $("#issue_watcher_user_ids_<%= user.id %>").remove();
<% end %>
-Element.insert('watchers_inputs', '<%= escape_javascript(watchers_checkboxes(nil, @users, true)) %>');
+$('#watchers_inputs').append('<%= escape_javascript(watchers_checkboxes(nil, @users, true)) %>');
diff --git a/app/views/watchers/create.js.erb b/app/views/watchers/create.js.erb
index d18152b76..0f7e15a00 100644
--- a/app/views/watchers/create.js.erb
+++ b/app/views/watchers/create.js.erb
@@ -1,2 +1,2 @@
-Element.update('ajax-modal', '<%= escape_javascript(render(:partial => 'watchers/new', :locals => {:watched => @watched})) %>');
-Element.update('watchers', '<%= escape_javascript(render(:partial => 'watchers/watchers', :locals => {:watched => @watched})) %>');
+$('#ajax-modal').html('<%= escape_javascript(render(:partial => 'watchers/new', :locals => {:watched => @watched})) %>');
+$('#watchers').html('<%= escape_javascript(render(:partial => 'watchers/watchers', :locals => {:watched => @watched})) %>');
diff --git a/app/views/watchers/destroy.js.erb b/app/views/watchers/destroy.js.erb
index 4c3bb1930..e4d856549 100644
--- a/app/views/watchers/destroy.js.erb
+++ b/app/views/watchers/destroy.js.erb
@@ -1 +1 @@
-Element.update('watchers', '<%= escape_javascript(render(:partial => 'watchers/watchers', :locals => {:watched => @watched})) %>');
+$('#watchers').html('<%= escape_javascript(render(:partial => 'watchers/watchers', :locals => {:watched => @watched})) %>');
diff --git a/app/views/watchers/new.js.erb b/app/views/watchers/new.js.erb
index c89dd1c95..6b99f657e 100644
--- a/app/views/watchers/new.js.erb
+++ b/app/views/watchers/new.js.erb
@@ -1,3 +1,3 @@
-Element.update('ajax-modal', '<%= escape_javascript(render :partial => 'watchers/new', :locals => {:watched => @watched}) %>');
+$('#ajax-modal').html('<%= escape_javascript(render :partial => 'watchers/new', :locals => {:watched => @watched}) %>');
showModal('ajax-modal', '400px');
-$('ajax-modal').addClassName('new-watcher');
+$('#ajax-modal').addClass('new-watcher');