Created
October 29, 2017 08:13
-
-
Save domagude/3e8b8d58ade7cb5cc0312c17c2e36d76 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on('turbolinks:load', function() { | |
// when a post is clicked, show its full content in a modal window | |
$("body").on( "click", ".single-post-card, .single-post-list", function() { | |
var posted_by = $(this).find('.post-content .posted-by').html(); | |
var post_heading = $(this).find('.post-content h3').html(); | |
var post_content = $(this).find('.post-content p').html(); | |
var interested = $(this).find('.post-content .interested').attr('href'); | |
$('.modal-header .posted-by').text(posted_by); | |
$('.loaded-data h3').text(post_heading); | |
$('.loaded-data p').text(post_content); | |
$('.loaded-data .interested a').attr('href', interested); | |
$('.myModal').modal('show'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment