socialforge/app/views/watchers/_set_watcher.js.erb

12 lines
415 B
Plaintext

<% selector = ".#{watcher_css(watched)}" %>
<% id_selector = "#{watcher_css(watched)}" %>
if($("<%= selector %>").get(0) == undefined)
{
$("#<%= id_selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link_for_project(watched, user) %>")});
}
else
{
$("<%= selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link(watched, user) %>")});
}