Sometimes I hate coding

This commit is contained in:
Michał Gdula 2023-04-19 18:11:19 +00:00
parent f26e76d822
commit 341d5b0ee8
3 changed files with 7 additions and 6 deletions

View file

@ -34,7 +34,7 @@ function popUpShow(titleText, subtitleText, bodyContent=null, userActions=null)
// Stop scrolling and show popup
document.querySelector("html").style.overflow = "hidden";
popupSelector.style.display = 'block';
setTimeout(function() { popupSelector.classList.add('active') }, 5); // 2ms delay to allow for css transition >:C
setTimeout(() => { popupSelector.classList.add('active') }, 5); // 2ms delay to allow for css transition >:C
}
function popupDissmiss() {
@ -42,5 +42,5 @@ function popupDissmiss() {
document.querySelector("html").style.overflow = "auto";
popupSelector.classList.remove('active');
setTimeout(function() { popupSelector.style.display = 'none'; }, 200);
setTimeout(() => { popupSelector.style.display = 'none'; }, 200);
}

View file

@ -52,10 +52,10 @@ function tabDragStart(event) {
uploadTab.classList.add("dragging");
document.addEventListener('touchmove', event => {
document.addEventListener('touchmove', moving => {
if (uploadTab.classList.contains("dragging")) {
if (event.touches[0].clientY - offset >= 0) {
uploadTab.dataset.lastY = event.touches[0].clientY;
if (moving.touches[0].clientY - offset >= 0) {
uploadTab.dataset.lastY = moving.touches[0].clientY;
} else {
uploadTab.dataset.lastY = offset;
}