summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-01-28 16:13:34 +0100
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-01-28 16:21:43 +0100
commit1cfe084cc29631ef0ae50611880a3bc8464999da (patch)
tree16c9112bfba0f1177b7da5ccebb1a0487cf1017f /client
parentae82f43078546902e199d985a922ebf7041a4917 (diff)
downloadwekan-1cfe084cc29631ef0ae50611880a3bc8464999da.tar.gz
wekan-1cfe084cc29631ef0ae50611880a3bc8464999da.tar.bz2
wekan-1cfe084cc29631ef0ae50611880a3bc8464999da.zip
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.
Diffstat (limited to 'client')
-rw-r--r--client/components/cards/cardDetails.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js
index 79a686a7..a571e21a 100644
--- a/client/components/cards/cardDetails.js
+++ b/client/components/cards/cardDetails.js
@@ -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);
}
},