mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-11 18:21:04 +08:00
17 lines
483 B
JavaScript
17 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);
|
||
|
}
|
||
|
});
|