mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-16 22:25:30 +08:00
16 lines
483 B
JavaScript
16 lines
483 B
JavaScript
// Show more activities link.
|
|
$(".btn-more-activities")
|
|
.on("ajax:success", function (e, data) {
|
|
if (data.html) {
|
|
var list = $("#list-activities");
|
|
var moreBtn = $(".btn-more-activities");
|
|
// Remove button if all activities are shown
|
|
if (data.results_number < data.per_page) {
|
|
moreBtn.remove();
|
|
// Otherwise update reference
|
|
} else {
|
|
moreBtn.attr("href", data.more_url);
|
|
}
|
|
$(list).append(data.html);
|
|
}
|
|
});
|