mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-22 11:57:34 +00:00
fixed bugs
This commit is contained in:
@@ -1022,6 +1022,7 @@ $('#private-share-form').submit(function() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
var last_start = 0; // for 'list_dir_more'
|
||||||
$(window).scroll(function() {
|
$(window).scroll(function() {
|
||||||
var file_topbar = $('.repo-file-list-topbar'),
|
var file_topbar = $('.repo-file-list-topbar'),
|
||||||
list_hd = $('.repo-file-list tr:first-child');
|
list_hd = $('.repo-file-list tr:first-child');
|
||||||
@@ -1032,10 +1033,12 @@ $(window).scroll(function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var ele_more = $('#repo-file-list .dirent-more');
|
var ele_more = $('#repo-file-list .dirent-more');
|
||||||
if (ele_more.length == 1 && $(window).scrollTop() + $(window).height() >= $(document).height() - parseInt($('#repo-file-list').css('margin-bottom'))) {
|
if (ele_more.length == 1 && $(window).scrollTop() + $(window).height() >= $(document).height() - parseInt($('#repo-file-list').css('margin-bottom')) && ele_more.data('start') != last_start) {
|
||||||
|
last_start = ele_more.data('start');
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url:'{% url 'list_dir_more' repo.id %}?p=' + e(cur_path) + '&start=' + e(ele_more.data('start')),
|
url:'{% url 'list_dir_more' repo.id %}?p=' + e(cur_path) + '&start=' + e(ele_more.data('start')),
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
|
cache: false,
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
var more_dirents = $(data['html']);
|
var more_dirents = $(data['html']);
|
||||||
more_dirents.appendTo($('.repo-file-list'));
|
more_dirents.appendTo($('.repo-file-list'));
|
||||||
@@ -1054,7 +1057,7 @@ $(window).scroll(function() {
|
|||||||
opOnDirent(more_dirents);
|
opOnDirent(more_dirents);
|
||||||
$('#name-down, #name-up, #time-up, #time-down').unbind().click(sortDirent);
|
$('#name-down, #name-up, #time-up, #time-down').unbind().click(sortDirent);
|
||||||
if (data['dirent_more']) {
|
if (data['dirent_more']) {
|
||||||
ele_more.attr('data-start', data['more_start']);
|
ele_more.data('start', data['more_start']);
|
||||||
} else {
|
} else {
|
||||||
ele_more.remove();
|
ele_more.remove();
|
||||||
}
|
}
|
||||||
|
@@ -275,8 +275,6 @@ def list_dir_more(request, repo_id):
|
|||||||
'path': path,
|
'path': path,
|
||||||
'dir_list': dir_list,
|
'dir_list': dir_list,
|
||||||
'file_list': file_list,
|
'file_list': file_list,
|
||||||
'dirent_more': dirent_more,
|
|
||||||
'more_start': more_start,
|
|
||||||
'ENABLE_SUB_LIBRARY': settings.ENABLE_SUB_LIBRARY,
|
'ENABLE_SUB_LIBRARY': settings.ENABLE_SUB_LIBRARY,
|
||||||
}
|
}
|
||||||
html = render_to_string('snippets/repo_dirents.html', ctx,
|
html = render_to_string('snippets/repo_dirents.html', ctx,
|
||||||
|
Reference in New Issue
Block a user