diff options
author | Lauri Ojansivu <x@xet7.org> | 2018-10-03 17:46:00 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2018-10-03 17:46:00 +0300 |
commit | 2206c5c84cdf8241e763fc23eceba26254de15e7 (patch) | |
tree | 4603710a695c2bfb398116c1708992ce47032478 /client/components/cards/cardDetails.js | |
parent | 5b8c642d8fb16e00000a1d92bcd3a5c6bbd07bce (diff) | |
download | wekan-2206c5c84cdf8241e763fc23eceba26254de15e7.tar.gz wekan-2206c5c84cdf8241e763fc23eceba26254de15e7.tar.bz2 wekan-2206c5c84cdf8241e763fc23eceba26254de15e7.zip |
- Fix Card URL https://github.com/wekan/wekan/pull/1932/files
Thanks to schulz !
Diffstat (limited to 'client/components/cards/cardDetails.js')
-rw-r--r-- | client/components/cards/cardDetails.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index 2cd399c1..da0f126a 100644 --- a/client/components/cards/cardDetails.js +++ b/client/components/cards/cardDetails.js @@ -69,6 +69,20 @@ BlazeComponent.extendComponent({ if (offset) { bodyBoardComponent.scrollLeft(cardContainerScroll + offset); } + + //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(topOffset !== false) { + bodyBoardComponent.scrollTop(topOffset); + } + }, presentParentTask() { @@ -96,7 +110,11 @@ BlazeComponent.extendComponent({ }, onRendered() { - if (!Utils.isMiniScreen()) this.scrollParentContainer(); + if (!Utils.isMiniScreen()) { + Meteor.setTimeout(() => { + this.scrollParentContainer(); + }, 500); + } const $checklistsDom = this.$('.card-checklist-items'); $checklistsDom.sortable({ |