Showing reviews on package's details page from Ubuntu

This commit is contained in:
Christoph Haas 2016-08-16 12:50:03 +02:00
parent fc95fc9d9a
commit 339bb0427f
10 changed files with 89 additions and 1 deletions

View file

@ -19,3 +19,21 @@
//= require_tree .
$(function(){ $(document).foundation(); });
// Load reviews on package's details page
load_reviews = function() {
// Display message while loading reviews
// $('#reviews').html("<i>Loading reviews...</i>");
// Hide the DIV so that in can be faded in later
$('#reviews').hide();
// The URL is specified in the #reviews's DIV data attribute
var url = $('#reviews').attr('data-package-reviews-url');
$('#reviews').load(url, null,
// Fade in the reviews as soon as the DIV is loaded and filled
function(){
$(this).fadeIn('slow')
}
);
};