mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
loading more items on ViewFolder page obeys sort order
This commit is contained in:
parent
cb03dacf45
commit
0767dadf39
|
@ -4,6 +4,7 @@
|
|||
- remove document/folder from index before adding a new one after editing the
|
||||
meta data
|
||||
- fix potential clickjacking attack with manipulated email address of a user
|
||||
- loading more items on ViewFolder page obeys sort order
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
Changes in version 5.1.21
|
||||
|
|
|
@ -130,7 +130,7 @@ function folderSelectedmaintree(id, name) {
|
|||
<?php } ?>
|
||||
}
|
||||
<?php if($maxItemsPerPage) { ?>
|
||||
function loadMoreObjects(element, limit) {
|
||||
function loadMoreObjects(element, limit, orderby) {
|
||||
if(!$(element).is(":visible"))
|
||||
return;
|
||||
element.text('<?= getMLText('more_objects_loading') ?>');
|
||||
|
@ -138,7 +138,7 @@ function loadMoreObjects(element, limit) {
|
|||
var folder = element.data('folder')
|
||||
var offset = element.data('offset')
|
||||
// var limit = element.data('limit')
|
||||
url = seeddms_webroot+"out/out.ViewFolder.php?action=entries&folderid="+folder+"&offset="+offset+"&limit="+limit<?= $orderby ? '+"&orderby='.$orderby.'"' : "" ?>;
|
||||
url = seeddms_webroot+"out/out.ViewFolder.php?action=entries&folderid="+folder+"&offset="+offset+"&limit="+limit+"&orderby="+orderby;
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: url,
|
||||
|
@ -158,11 +158,11 @@ function loadMoreObjects(element, limit) {
|
|||
}
|
||||
$(window).scroll(function() {
|
||||
if($(window).scrollTop() + $(window).height() == $(document).height()) {
|
||||
loadMoreObjects($('#loadmore'), $('#loadmore').data('limit'));
|
||||
loadMoreObjects($('#loadmore'), $('#loadmore').data('limit'), $('#loadmore').data('orderby'));
|
||||
}
|
||||
});
|
||||
$('body').on('click', '#loadmore', function(e) {
|
||||
loadMoreObjects($(this), $(this).data('all'));
|
||||
loadMoreObjects($(this), $(this).data('all'), $(this).data('orderby'));
|
||||
});
|
||||
|
||||
<?php } ?>
|
||||
|
@ -426,7 +426,7 @@ $('body').on('click', '.order-btn', function(ev) {
|
|||
echo "</tbody>\n</table>\n";
|
||||
|
||||
if($maxItemsPerPage && $i > $maxItemsPerPage)
|
||||
echo "<button id=\"loadmore\" style=\"width: 100%; margin-bottom: 20px;\" class=\"btn btn-secondary\" data-folder=\"".$folder->getId()."\"data-offset=\"".$maxItemsPerPage."\" data-limit=\"".$incItemsPerPage."\" data-all=\"".($i-$maxItemsPerPage)."\">".getMLText('x_more_objects', array('number'=>($i-$maxItemsPerPage)))."</button>";
|
||||
echo "<button id=\"loadmore\" style=\"width: 100%; margin-bottom: 20px;\" class=\"btn btn-secondary\" data-folder=\"".$folder->getId()."\"data-offset=\"".$maxItemsPerPage."\" data-limit=\"".$incItemsPerPage."\" data-orderby=\"".$orderby."\" data-all=\"".($i-$maxItemsPerPage)."\">".getMLText('x_more_objects', array('number'=>($i-$maxItemsPerPage)))."</button>";
|
||||
}
|
||||
else printMLText("empty_folder_list");
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user