summaryrefslogtreecommitdiffstats
path: root/client/components/lists
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2018-01-28 00:02:35 +0200
committerLauri Ojansivu <x@xet7.org>2018-01-28 00:02:35 +0200
commit6aca70f0d11cd93355f65356c5550e7071f42aaa (patch)
tree62f9fb26fb52ae9f71c1f09d37af9058fa00ed75 /client/components/lists
parent963e3193451327cec89da2abc1f4aee7ee308f08 (diff)
parent081c1fdf835c6f1d2030b3b9e23229378d4f8cce (diff)
downloadwekan-6aca70f0d11cd93355f65356c5550e7071f42aaa.tar.gz
wekan-6aca70f0d11cd93355f65356c5550e7071f42aaa.tar.bz2
wekan-6aca70f0d11cd93355f65356c5550e7071f42aaa.zip
Merge branch 'devel'
Diffstat (limited to 'client/components/lists')
-rw-r--r--client/components/lists/list.js7
-rw-r--r--client/components/lists/list.styl5
-rw-r--r--client/components/lists/listBody.jade2
-rw-r--r--client/components/lists/listBody.js16
4 files changed, 24 insertions, 6 deletions
diff --git a/client/components/lists/list.js b/client/components/lists/list.js
index a65ccc56..e922a3fd 100644
--- a/client/components/lists/list.js
+++ b/client/components/lists/list.js
@@ -18,7 +18,7 @@ BlazeComponent.extendComponent({
// callback, we basically solve all issues related to reactive updates. A
// comment below provides further details.
onRendered() {
- const boardComponent = this.parentComponent();
+ const boardComponent = this.parentComponent().parentComponent();
const itemsSelector = '.js-minicard:not(.placeholder, .js-card-composer)';
const $cards = this.$('.js-minicards');
$cards.sortable({
@@ -55,6 +55,7 @@ BlazeComponent.extendComponent({
const nCards = MultiSelection.isActive() ? MultiSelection.count() : 1;
const sortIndex = calculateIndex(prevCardDom, nextCardDom, nCards);
const listId = Blaze.getData(ui.item.parents('.list').get(0))._id;
+ const swimlaneId = Blaze.getData(ui.item.parents('.swimlane').get(0))._id;
// Normally the jquery-ui sortable library moves the dragged DOM element
// to its new position, which disrupts Blaze reactive updates mechanism
@@ -67,12 +68,12 @@ BlazeComponent.extendComponent({
if (MultiSelection.isActive()) {
Cards.find(MultiSelection.getMongoSelector()).forEach((card, i) => {
- card.move(listId, sortIndex.base + i * sortIndex.increment);
+ card.move(swimlaneId, listId, sortIndex.base + i * sortIndex.increment);
});
} else {
const cardDomElement = ui.item.get(0);
const card = Blaze.getData(cardDomElement);
- card.move(listId, sortIndex.base);
+ card.move(swimlaneId, listId, sortIndex.base);
}
boardComponent.setIsDragging(false);
},
diff --git a/client/components/lists/list.styl b/client/components/lists/list.styl
index d5800140..c3753360 100644
--- a/client/components/lists/list.styl
+++ b/client/components/lists/list.styl
@@ -9,7 +9,6 @@
// Even if this background color is the same as the body we can't leave it
// transparent, because that won't work during a list drag.
background: darken(white, 13%)
- height: 100%
border-left: 1px solid darken(white, 20%)
padding: 0
float: left
@@ -88,12 +87,14 @@
.list-body
flex: 1
+ flex-direction: column
display: flex
overflow-y: auto
padding: 5px 11px
.minicards
- flex: 1
+ flex-grow: 1
+ flex-shrink: 0
form
margin-bottom: 9px
diff --git a/client/components/lists/listBody.jade b/client/components/lists/listBody.jade
index 840fd801..32c6b278 100644
--- a/client/components/lists/listBody.jade
+++ b/client/components/lists/listBody.jade
@@ -4,7 +4,7 @@ template(name="listBody")
if cards.count
+inlinedForm(autoclose=false position="top")
+addCardForm(listId=_id position="top")
- each cards
+ each (cards (idOrNull ../../_id))
a.minicard-wrapper.js-minicard(href=absoluteUrl
class="{{#if cardIsSelected}}is-selected{{/if}}"
class="{{#if MultiSelection.isSelected _id}}is-checked{{/if}}")
diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js
index fe2f1630..6cc94371 100644
--- a/client/components/lists/listBody.js
+++ b/client/components/lists/listBody.js
@@ -36,6 +36,14 @@ BlazeComponent.extendComponent({
const members = formComponent.members.get();
const labelIds = formComponent.labels.get();
+ const boardId = this.data().board()._id;
+ const board = Boards.findOne(boardId);
+ let swimlaneId = '';
+ if (board.view === 'board-view-swimlanes')
+ swimlaneId = this.parentComponent().parentComponent().data()._id;
+ else
+ swimlaneId = Swimlanes.findOne({boardId})._id;
+
if (title) {
const _id = Cards.insert({
title,
@@ -44,6 +52,7 @@ BlazeComponent.extendComponent({
listId: this.data()._id,
boardId: this.data().board()._id,
sort: sortIndex,
+ swimlaneId,
});
// In case the filter is active we need to add the newly inserted card in
// the list of exceptions -- cards that are not filtered. Otherwise the
@@ -96,6 +105,13 @@ BlazeComponent.extendComponent({
MultiSelection.toggle(this.currentData()._id);
},
+ idOrNull(swimlaneId) {
+ const board = Boards.findOne(Session.get('currentBoard'));
+ if (board.view === 'board-view-swimlanes')
+ return swimlaneId;
+ return undefined;
+ },
+
canSeeAddCard() {
return !this.reachedWipLimit() && Meteor.user() && Meteor.user().isBoardMember() && !Meteor.user().isCommentOnly();
},