Skip to content

Commit

Permalink
changes on javascript
Browse files Browse the repository at this point in the history
  • Loading branch information
diegocarrera committed Oct 13, 2010
1 parent 55352a0 commit 290b428
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
6 changes: 3 additions & 3 deletions app/views/activities/_activity_options.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div class="activity_options">
<ul class="activity_options" >
<li><div class="post_time_ago"><%= t('time.ago', :time => time_ago_in_words(activity.created_at)) %></div></li>
<li class="icon_blue"><div class="verb_comment"><%= link_to t('activity.to_comment'), "", :class => "to_comment" %> </div></li>
<li class="icon_blue"><div class="verb_like" id="like_<%= dom_id(activity) %>"> <%= like_activity(activity)%></div></li>
<li class="icon_blue"><div class="verb_delete"><%= link_to t('activity.delete'), activity.direct_object , :confirm => t('activity.confirm_delete'), :method => :delete, :remote => true %> </div></li>
<li><div class="verb_comment"> · <%= link_to t('activity.to_comment'), "#", :class => "to_comment" %> </div></li>
<li><div class="verb_like" id="like_<%= dom_id(activity) %>"> · <%= like_activity(activity)%></div></li>
<li><div class="verb_delete"> · <%= link_to t('activity.delete'), activity.direct_object , :confirm => t('activity.confirm_delete'), :method => :delete, :remote => true %> </div></li>
</ul>
</div>
17 changes: 10 additions & 7 deletions app/views/activities/_jquery.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ $("#input_activities").blur(function(){
//javascript for comments
$(".input_new_comments").val("<%= t('comment.input') %>");
$(".activities_comment_btn").hide();

//usa livequery para usar el javascript luego de una accion con AJAX
$(".input_new_comments").livequery("click",function(){
if(this.value == "<%= t('comment.input') %>"){
$(this).val("");
Expand All @@ -27,9 +29,12 @@ $(".input_new_comments").livequery("click",function(){
$(".input_new_comments").livequery("blur",function(){
if(this.value == ""){
$(".activities_comment_btn").hide();
$(this).val("<%= t('comment.input') %>");
}
});
$(".comment").click(function(){


$(".input_new_comments").click(function(){
if(this.value == "<%= t('comment.input') %>"){
$(this).val("");
}
Expand All @@ -39,13 +44,11 @@ $(".comment").click(function(){


//javascript for tocomment option
$(".tocomment").livequery("click", function(){
// $(this).parents(".content_post").children(".content_sub_post").children(".coment_field").children(".new_comment").children(".input_new_comments").click();
$(this).parents(".content_post").find(".input_new_comments").click();
$(".to_comment").livequery("click", function(){
$(this).parents(".activity_content").find(".input_new_comments").click();
return false;
});
$(".tocomment").livequery("blur", function(){
//$(this).parents(".content_post").children(".content_sub_post").children(".coment_field").children(".new_comment").children(".input_new_comments").blur();
$(this).parents(".content_post").find(".input_new_comments").blur();
$(".to_comment").livequery("blur", function(){
$(this).parents(".activity_content").find(".input_new_comments").blur();
return false;
});

0 comments on commit 290b428

Please sign in to comment.