mirror of
https://github.com/gogs/gogs.git
synced 2025-12-20 15:20:01 +01:00
dashboard/feeds: able to load more history (#2511)
This commit is contained in:
@@ -1339,6 +1339,30 @@ $(document).ready(function () {
|
||||
e.trigger.setAttribute('data-content', e.trigger.getAttribute('data-original'))
|
||||
});
|
||||
|
||||
// AJAX load buttons
|
||||
$('.ajax-load-button').click(function () {
|
||||
var $this = $(this);
|
||||
$this.addClass('disabled');
|
||||
|
||||
$.ajax({
|
||||
url: $this.data('url'),
|
||||
headers: {
|
||||
'X-AJAX': "true"
|
||||
}
|
||||
}).success(function (data, status, request) {
|
||||
$(data).insertBefore($this);
|
||||
|
||||
// Update new URL or remove self if no more feeds
|
||||
var url = request.getResponseHeader('X-AJAX-URL');
|
||||
if (url) {
|
||||
$this.data('url', url);
|
||||
$this.removeClass('disabled');
|
||||
} else {
|
||||
$this.remove();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Helpers.
|
||||
$('.delete-button').click(function () {
|
||||
var $this = $(this);
|
||||
|
||||
Reference in New Issue
Block a user