mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-13 11:54:32 +02:00
Implemented scroll to top using stimulus.
This commit is contained in:
parent
8ccf5652ab
commit
1f890efc97
3 changed files with 30 additions and 27 deletions
|
@ -7,13 +7,9 @@ import "bootstrap-fileinput/css/fileinput.css"
|
|||
|
||||
import "bootstrap-fileinput";
|
||||
|
||||
import {Popover} from "bootstrap";
|
||||
|
||||
|
||||
class RegisterEventHelper {
|
||||
constructor() {
|
||||
this.registerTooltips();
|
||||
this.registerJumpToTopBtn();
|
||||
this.registerFileInput();
|
||||
|
||||
this.registerSpecialCharInput();
|
||||
|
@ -39,26 +35,6 @@ class RegisterEventHelper {
|
|||
});
|
||||
}
|
||||
|
||||
registerJumpToTopBtn() {
|
||||
this.registerLoadHandler(() => {
|
||||
$(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();
|
||||
});
|
||||
}
|
||||
|
||||
registerSpecialCharInput() {
|
||||
this.registerLoadHandler(() => {
|
||||
//@ts-ignore
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue