fixed comments not showing up through websocket on photo show page

This commit is contained in:
danielvincent 2010-10-20 23:40:48 -07:00
parent 82e947a74a
commit 8e175be2ba
6 changed files with 72 additions and 68 deletions

View file

@ -8,10 +8,14 @@
$("#add_album_button").fancybox();
});
.span-4.append-1.last
= render "shared/aspect_friends"
%h2
= @aspect
.friend_pictures.horizontal
= owner_image_link
- for friend in @friends
= person_image_link(friend)
.span-15.last
.span-24.last
%h3
= @aspect
Albums

View file

@ -44,12 +44,13 @@
}
function processComment(post_id, html){
post = $('#' + post_id)[0]
post = $("*[data-guid='"+post_id+"']'");
$(' .comment_set li:last', post ).before(
$(html).fadeIn("fast", function(){})
);
toggler = $('.show_post_comments', post)
if(toggler.length > 0){
toggler.html(
toggler.html().replace(/\d+/,$('.comment_set', post)[0].childElementCount -1));
@ -57,6 +58,7 @@
toggler.click();
}
}
}
function processPost(className, html, aspectIds){
if(onPageForAspects(aspectIds)){

View file

@ -2,7 +2,8 @@
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
:javascript
- content_for :head do
:javascript
$(document).keydown(function(e){
switch(e.keyCode) {
case 37:
@ -64,6 +65,12 @@
%h3
= link_to @photo.album.name, @photo.album
= link_to "<< #{t('.prev')}", url_to_prev(@photo, @album), :rel => 'prefetch'
|
= link_to "#{t('.full_size')}", @photo.url
|
= link_to "#{t('.next')} >>", url_to_next(@photo, @album), :rel => 'prefetch'
.span-14.append-1.last
%div{:data=>{:guid=>@photo.id}}
#show_photo
@ -72,8 +79,6 @@
.edit_pane
.controls{:data=>{:actor=>"#{@photo.person.owner.id}",:actor_person=>"#{@photo.person.id}",:image_url=>"#{@photo.url(:thumb_medium)}"}}
= link_to 'make profile photo', '#', :class => "make_profile_photo"
|
= link_to 'edit', '#', :class => "make_profile_photo"
= linked_scaled_photo @photo, @album
-else
= linked_scaled_photo @photo, @album
@ -100,13 +105,6 @@
= link_to t('.delete_photo'), @photo, :confirm => t('.are_you_sure'), :method => :delete, :class => 'button'
.span-9.last
= link_to "<< #{t('.prev')}", url_to_prev(@photo, @album), :rel => 'prefetch'
|
= link_to "#{t('.full_size')}", @photo.url
|
= link_to "#{t('.next')} >>", url_to_next(@photo, @album), :rel => 'prefetch'
%br
%br
#stream.show
%li.message{:id => @photo.id}
%li.message{:data=>{:guid=>@photo.id}}
= render "comments/comments", :post => @photo

View file

@ -26,5 +26,5 @@
.span-9.last
#stream.show
%li.message{:id => @status_message.id}
%li.message{:data=>{:guid=>@status_message.id}}
= render "comments/comments", :post => @status_message

View file

@ -47,7 +47,7 @@ $(document).ready(function(){
}
);
$("#publisher textarea, .comment textarea").keydown( function(e) {
$("#publisher textarea, .comment_box").keydown( function(e) {
if (e.keyCode == 13) {
$(this).closest("form").submit();
}

View file

@ -180,7 +180,7 @@ header
#global_search
:margin
:left 425px
:left 432px
#stream
:margin 0
@ -1015,8 +1015,8 @@ ul#settings_nav
:left 20px
img
:width 20px
:height 20px
:width 30px
:height 30px
:margin-right -4px
#thumbnails
@ -1070,7 +1070,7 @@ input[type="search"]
header
input[type="search"]
:width 200px
:width 192px
.fancybox_content
:display none