summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2018-02-01 16:49:06 +0200
committerLauri Ojansivu <x@xet7.org>2018-02-01 16:49:06 +0200
commitefa2d99bf40d0f0fd4d89d3001cbb60ee18e18ac (patch)
treeed6890f993cdf351038db43857d2288fc6df6b47 /client
parent8d816cdb0f27656b5b56a6a8d15990bcd5a595e4 (diff)
parentd94f11c7786a48112bd9b024ef7794091b74bb40 (diff)
downloadwekan-efa2d99bf40d0f0fd4d89d3001cbb60ee18e18ac.tar.gz
wekan-efa2d99bf40d0f0fd4d89d3001cbb60ee18e18ac.tar.bz2
wekan-efa2d99bf40d0f0fd4d89d3001cbb60ee18e18ac.zip
Merge branch 'devel'
Diffstat (limited to 'client')
-rw-r--r--client/components/lists/list.js4
-rw-r--r--client/components/lists/listsGroup.js13
-rw-r--r--client/components/swimlanes/swimlanes.jade4
-rw-r--r--client/components/swimlanes/swimlanes.js12
4 files changed, 27 insertions, 6 deletions
diff --git a/client/components/lists/list.js b/client/components/lists/list.js
index e922a3fd..ce18ce14 100644
--- a/client/components/lists/list.js
+++ b/client/components/lists/list.js
@@ -18,7 +18,9 @@ BlazeComponent.extendComponent({
// callback, we basically solve all issues related to reactive updates. A
// comment below provides further details.
onRendered() {
- const boardComponent = this.parentComponent().parentComponent();
+ let boardComponent = this.parentComponent().parentComponent();
+ if (!boardComponent)
+ boardComponent = this.parentComponent();
const itemsSelector = '.js-minicard:not(.placeholder, .js-card-composer)';
const $cards = this.$('.js-minicards');
$cards.sortable({
diff --git a/client/components/lists/listsGroup.js b/client/components/lists/listsGroup.js
new file mode 100644
index 00000000..f94f681f
--- /dev/null
+++ b/client/components/lists/listsGroup.js
@@ -0,0 +1,13 @@
+BlazeComponent.extendComponent({
+ currentCardIsInThisList(listId, swimlaneId) {
+ const currentCard = Cards.findOne(Session.get('currentCard'));
+ const currentBoardId = Session.get('currentBoard');
+ const board = Boards.findOne(currentBoardId);
+ if (board.view === 'board-view-lists')
+ return currentCard && currentCard.listId === listId;
+ else if (board.view === 'board-view-swimlanes')
+ return currentCard && currentCard.listId === listId && currentCard.swimlaneId === swimlaneId;
+ else
+ return false;
+ },
+}).register('listsGroup');
diff --git a/client/components/swimlanes/swimlanes.jade b/client/components/swimlanes/swimlanes.jade
index 77afa399..765f6d49 100644
--- a/client/components/swimlanes/swimlanes.jade
+++ b/client/components/swimlanes/swimlanes.jade
@@ -14,7 +14,7 @@ template(name="swimlane")
else
each currentBoard.lists
+list(this)
- if currentCardIsInThisList
+ if currentCardIsInThisList _id ../_id
+cardDetails(currentCard)
if currentUser.isBoardMember
+addListForm
@@ -33,7 +33,7 @@ template(name="listsGroup")
else
each currentBoard.lists
+list(this)
- if currentCardIsInThisList
+ if currentCardIsInThisList _id null
+cardDetails(currentCard)
if currentUser.isBoardMember
+addListForm
diff --git a/client/components/swimlanes/swimlanes.js b/client/components/swimlanes/swimlanes.js
index 397f9e9b..211f84f2 100644
--- a/client/components/swimlanes/swimlanes.js
+++ b/client/components/swimlanes/swimlanes.js
@@ -28,10 +28,16 @@ BlazeComponent.extendComponent({
});
},
- currentCardIsInThisList() {
+ currentCardIsInThisList(listId, swimlaneId) {
const currentCard = Cards.findOne(Session.get('currentCard'));
- const listId = this.currentData()._id;
- return currentCard && currentCard.listId === listId; //TODO: AND IN THIS SWIMLANE
+ const currentBoardId = Session.get('currentBoard');
+ const board = Boards.findOne(currentBoardId);
+ if (board.view === 'board-view-lists')
+ return currentCard && currentCard.listId === listId;
+ else if (board.view === 'board-view-swimlanes')
+ return currentCard && currentCard.listId === listId && currentCard.swimlaneId === swimlaneId;
+ else
+ return false;
},
events() {