mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
automatic scroll: fix vertical automatic scrolling when opening a card
We actually want the vertical scrolling to be fixed when opening the card details. I am not sure where the `100` value comes from, but this makes the scrolling happy on the swimlane view and on the lists view.
This commit is contained in:
parent
ae82f43078
commit
1cfe084cc2
1 changed files with 4 additions and 5 deletions
|
|
@ -78,14 +78,13 @@ BlazeComponent.extendComponent({
|
|||
//Scroll top
|
||||
const cardViewStartTop = $cardView.offset().top;
|
||||
const cardContainerScrollTop = $cardContainer.scrollTop();
|
||||
|
||||
let topOffset = false;
|
||||
if(cardViewStartTop < 0){
|
||||
topOffset = 0;
|
||||
} else if(cardViewStartTop - cardContainerScrollTop > 100) {
|
||||
topOffset = cardViewStartTop - cardContainerScrollTop - 100;
|
||||
if(cardViewStartTop !== 100){
|
||||
topOffset = cardViewStartTop - 100;
|
||||
}
|
||||
if(topOffset !== false) {
|
||||
bodyBoardComponent.scrollTop(topOffset);
|
||||
bodyBoardComponent.scrollTop(cardContainerScrollTop + topOffset);
|
||||
}
|
||||
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue