mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-11 10:32:24 +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 () {
|
$('#cancel-request').click(function () {
|
||||||
hideRequestTable();
|
hideRequestTable();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.pagenum').change(function(){
|
$('.pagenum').change(function(){
|
||||||
getSongs();
|
getSongs();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#search-all, #search-uploader').change(function(){
|
$('#search-all, #search-uploader').change(function(){
|
||||||
$('.pagenum').val(1);
|
$('.pagenum').val(1);
|
||||||
getSongs();
|
getSongs();
|
||||||
@ -63,24 +63,24 @@ $(function () {
|
|||||||
$('.pagenum').val(1);
|
$('.pagenum').val(1);
|
||||||
getSongs();
|
getSongs();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('button.prev').click(function(){
|
$('button.prev').click(function(){
|
||||||
var pageNumSelect = $('.pagenum');
|
var pageNumSelect = $('.pagenum');
|
||||||
pageNumSelect.val(Math.max(parseInt(pageNumSelect.val()) - 1, 1));
|
pageNumSelect.val(Math.max(parseInt(pageNumSelect.val()) - 1, 1));
|
||||||
getSongs();
|
getSongs();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('button.next').click(function(){
|
$('button.next').click(function(){
|
||||||
var pageNumSelect = $('.pagenum');
|
var pageNumSelect = $('.pagenum');
|
||||||
pageNumSelect.val(Math.min(parseInt(pageNumSelect.val()) + 1, pageNumSelect.children('option:last-child').val()));
|
pageNumSelect.val(Math.min(parseInt(pageNumSelect.val()) + 1, pageNumSelect.children('option:last-child').val()));
|
||||||
getSongs();
|
getSongs();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('button.first').click(function(){
|
$('button.first').click(function(){
|
||||||
$('.pagenum').val(1);
|
$('.pagenum').val(1);
|
||||||
getSongs();
|
getSongs();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('button.last').click(function(){
|
$('button.last').click(function(){
|
||||||
var pageNumSelect = $('.pagenum');
|
var pageNumSelect = $('.pagenum');
|
||||||
pageNumSelect.val(pageNumSelect.children('option:last-child').val());
|
pageNumSelect.val(pageNumSelect.children('option:last-child').val());
|
||||||
@ -279,6 +279,10 @@ function getSongs()
|
|||||||
}
|
}
|
||||||
pageNumSelect.val(result.current_page);
|
pageNumSelect.val(result.current_page);
|
||||||
$('.pagesize').val(result.per_page);
|
$('.pagesize').val(result.per_page);
|
||||||
|
refreshingSongs = false;
|
||||||
|
if(requestViewOpen) {
|
||||||
|
window.scrollTo(0, 0);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user