mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-13 11:54:32 +02:00
Enabled treeview with turbo frames.
This commit is contained in:
parent
7b244d3034
commit
41e0b251a9
5 changed files with 211 additions and 17 deletions
27
assets/js/events_base.js
Normal file
27
assets/js/events_base.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
function registerLoadHandler(fn) {
|
||||
document.documentElement.addEventListener('turbo:load', fn);
|
||||
}
|
||||
|
||||
|
||||
registerLoadHandler(function() {
|
||||
/**
|
||||
* Register the button, to jump to the top of the page.
|
||||
*/
|
||||
$(document).on("ajaxUI:start", function registerJumpToTop() {
|
||||
$(window).scroll(function () {
|
||||
if ($(this).scrollTop() > 50) {
|
||||
$('#back-to-top').fadeIn();
|
||||
} else {
|
||||
$('#back-to-top').fadeOut();
|
||||
}
|
||||
});
|
||||
// scroll body to 0px on click
|
||||
$('#back-to-top').click(function () {
|
||||
$('#back-to-top').tooltip('hide');
|
||||
$('body,html').animate({
|
||||
scrollTop: 0
|
||||
}, 800);
|
||||
return false;
|
||||
}).tooltip();
|
||||
});
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue