mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-09 18:52:23 +01:00
Scroll to top when searching is complete.
This commit is contained in:
committed by
Daan Sprenkels
parent
04cdce9ad4
commit
f50e76626c
@ -48,11 +48,11 @@ $(function () {
|
||||
$('#cancel-request').click(function () {
|
||||
hideRequestTable();
|
||||
});
|
||||
|
||||
|
||||
$('.pagenum').change(function(){
|
||||
getSongs();
|
||||
});
|
||||
|
||||
|
||||
$('#search-all, #search-uploader').change(function(){
|
||||
$('.pagenum').val(1);
|
||||
getSongs();
|
||||
@ -63,24 +63,24 @@ $(function () {
|
||||
$('.pagenum').val(1);
|
||||
getSongs();
|
||||
});
|
||||
|
||||
|
||||
$('button.prev').click(function(){
|
||||
var pageNumSelect = $('.pagenum');
|
||||
pageNumSelect.val(Math.max(parseInt(pageNumSelect.val()) - 1, 1));
|
||||
getSongs();
|
||||
});
|
||||
|
||||
|
||||
$('button.next').click(function(){
|
||||
var pageNumSelect = $('.pagenum');
|
||||
pageNumSelect.val(Math.min(parseInt(pageNumSelect.val()) + 1, pageNumSelect.children('option:last-child').val()));
|
||||
getSongs();
|
||||
});
|
||||
|
||||
|
||||
$('button.first').click(function(){
|
||||
$('.pagenum').val(1);
|
||||
getSongs();
|
||||
});
|
||||
|
||||
|
||||
$('button.last').click(function(){
|
||||
var pageNumSelect = $('.pagenum');
|
||||
pageNumSelect.val(pageNumSelect.children('option:last-child').val());
|
||||
@ -279,6 +279,10 @@ function getSongs()
|
||||
}
|
||||
pageNumSelect.val(result.current_page);
|
||||
$('.pagesize').val(result.per_page);
|
||||
refreshingSongs = false;
|
||||
if(requestViewOpen) {
|
||||
window.scrollTo(0, 0);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user