diff options
Diffstat (limited to 'client/components/lists')
-rw-r--r-- | client/components/lists/list.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/client/components/lists/list.js b/client/components/lists/list.js index f5410ed0..e454cb48 100644 --- a/client/components/lists/list.js +++ b/client/components/lists/list.js @@ -22,9 +22,6 @@ BlazeComponent.extendComponent({ // callback, we basically solve all issues related to reactive updates. A // comment below provides further details. onRendered() { - if (!Meteor.user() || !Meteor.user().isBoardMember()) - return; - const boardComponent = this.parentComponent(); const itemsSelector = '.js-minicard:not(.placeholder, .js-card-composer)'; const $cards = this.$('.js-minicards'); @@ -85,6 +82,15 @@ BlazeComponent.extendComponent({ }, }); + function userIsMember() { + return Meteor.user() && Meteor.user().isBoardMember(); + } + + // Disable drag-dropping if the current user is not a board member + this.autorun(() => { + $cards.sortable('option', 'disabled', !userIsMember()); + }); + // We want to re-run this function any time a card is added. this.autorun(() => { const currentBoardId = Tracker.nonreactive(() => { |