diff options
author | Lauri Ojansivu <x@xet7.org> | 2018-10-03 16:43:11 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2018-10-03 16:43:11 +0300 |
commit | 7ca21d52601429e438497d7ade97b7bee27e87c3 (patch) | |
tree | c32e17a265f23067a6edfd5c4c9bb6bf792fcebd | |
parent | 1d803d4b5185f6941d3589a48e355f04e8538f55 (diff) | |
parent | 111e4d8478e79f578ae20a72c951b614ba81ef86 (diff) | |
download | wekan-7ca21d52601429e438497d7ade97b7bee27e87c3.tar.gz wekan-7ca21d52601429e438497d7ade97b7bee27e87c3.tar.bz2 wekan-7ca21d52601429e438497d7ade97b7bee27e87c3.zip |
Merge branch 'schulz-devel' into devel
-rw-r--r-- | client/components/boards/boardBody.js | 7 | ||||
-rw-r--r-- | client/components/cards/cardDetails.js | 20 | ||||
-rwxr-xr-x | client/components/main/editor.js | 5 |
3 files changed, 30 insertions, 2 deletions
diff --git a/client/components/boards/boardBody.js b/client/components/boards/boardBody.js index b68c9b12..ccbd0f23 100644 --- a/client/components/boards/boardBody.js +++ b/client/components/boards/boardBody.js @@ -147,6 +147,13 @@ BlazeComponent.extendComponent({ }); }, + scrollTop(position = 0) { + const swimlanes = this.$('.js-swimlanes'); + swimlanes && swimlanes.animate({ + scrollTop: position, + }); + }, + }).register('boardBody'); BlazeComponent.extendComponent({ diff --git a/client/components/cards/cardDetails.js b/client/components/cards/cardDetails.js index 2cd399c1..d1bb3a1e 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({ diff --git a/client/components/main/editor.js b/client/components/main/editor.js index 888fbe00..20ece562 100755 --- a/client/components/main/editor.js +++ b/client/components/main/editor.js @@ -38,7 +38,10 @@ Blaze.Template.registerHelper('mentions', new Template('mentions', function() { const view = this; const currentBoard = Boards.findOne(Session.get('currentBoard')); const knowedUsers = currentBoard.members.map((member) => { - member.username = Users.findOne(member.userId).username; + const u = Users.findOne(member.userId); + if(u){ + member.username = u.username; + } return member; }); const mentionRegex = /\B@([\w.]*)/gi; |