mirror of
https://github.com/pretix/pretix.git
synced 2026-05-03 14:54:04 +00:00
Fix: Day calendar - scroll current .tick into view without window being scrolled (#2365)
This commit is contained in:
committed by
GitHub
parent
4133e5ac4d
commit
2d37b0df77
@@ -567,10 +567,13 @@ $(function () {
|
||||
currentTick = ticks[i]
|
||||
t = parseInt(currentTick.getAttribute("data-start").replace(":", ""), 10);
|
||||
if (t > currentTimeCmp) {
|
||||
currentTick = ticks[Math.max(i-1, 0)]
|
||||
break;
|
||||
}
|
||||
}
|
||||
currentTick.scrollIntoView({behavior:"smooth", inline: "center"});
|
||||
if (currentTick.offsetLeft > 0.66*this.offsetWidth) {
|
||||
this.scrollLeft = Math.max(currentTick.offsetLeft - this.offsetWidth/2, 0);
|
||||
}
|
||||
|
||||
|
||||
var thisCalendar = this;
|
||||
|
||||
Reference in New Issue
Block a user