Most post like into a wrapper in the html

This commit is contained in:
Brenda Wallace committed 2019-07-12 08:47:22 +12:00
1 parent 80429f935a
commit 7d1f9c5a3a
2 files changed
+5 -4

No files matched your search

+3 -3
View File
@@ -19,9 +19,9 @@ $(document).ready(function() {
$('.photo-like').show();
$('.photo-like').on('ajax:success', function(event, data) {
var likeControl = $('.photo-like');
$('.like-count').text(data.description);
var likeControl = $('#photo-'+ data.id + ' .photo-like');
console.log(data);
$('#photo-' + data.id + ' .like-count').text(data.description);
if (data.liked_by_member) {
likeControl.data('method', 'delete');
likeControl.attr('href', data.url);
+2 -1
View File
@@ -11,12 +11,13 @@
%li.breadcrumb-item= link_to 'Photos', photos_path
%li.breadcrumb-item.active= link_to @photo, @photo
.row
.row{id: "photo-#{@photo.id}"}
.col-md-8
%h1.text-center.ellipsis=@photo.title
%p.text-center
= image_tag(@photo.fullsize_url, alt: @photo.title, class: 'rounded img-fluid shadow-sm')
.col-md-4
%p.text-center{ id: "photo-#{@photo.id}" }
= render 'photos/actions', photo: @photo
= link_to "View on Flickr", @photo.link_url, class: 'btn'